Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#34441 closed enhancement (duplicate)

Make WP_DEBUG_LOG to match a path

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

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 11 years ago.

Download all attachments as: .zip

Change History (4)

@juliobox
11 years ago

#1 @SergeyBiryukov
11 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
11 years ago

  • Component General → Bootstrap/Load

#3 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

Actually, a duplicate of #18391.

Note: See TracTickets for help on using tickets.