Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#34441 closed enhancement (duplicate)

Make WP_DEBUG_LOG to match a path

Reported by: juliobox's profile juliobox Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: Bootstrap/Load Keywords:
Focuses: Cc:

Description

Hello,

i propose to make the possibility for WP_DEBUG_LOG to be a path to a log file like ERRORLOGFILE already is.

False = no log,
True = actuel default path wp-content/debug.log
/home/logs/wp.log = this file!

The patch includes 2 files, code and docs.

Thank you

Attachments (1)

34441.patch (1.6 KB) - added by juliobox 9 years ago.

Download all attachments as: .zip

Change History (4)

@juliobox
9 years ago

#1 @SergeyBiryukov
9 years ago

This sounds like a good idea, but needs a bit more accurate logic. Looks like null, 0 or 1 would be treated as a path now.

Something like this might work:

if ( WP_DEBUG_LOG ) {
	ini_set( 'log_errors', 1 );
	if ( is_string( WP_DEBUG_LOG ) ) {
		ini_set( 'error_log', WP_DEBUG_LOG );
	} else {
		ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
	}
}

#2 @SergeyBiryukov
9 years ago

  • Component changed from General to Bootstrap/Load

#3 @SergeyBiryukov
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Actually, a duplicate of #18391.

Note: See TracTickets for help on using tickets.