[wp-trac] [WordPress Trac] #56035: Error logging improvements

WordPress Trac noreply at wordpress.org
Tue Aug 2 19:00:49 UTC 2022


#56035: Error logging improvements
-------------------------+------------------------------
 Reporter:  galbaras     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Site Health  |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:5 galbaras]:
 > According to the documentation:
 >
 > > WP_DEBUG_LOG is a companion to WP_DEBUG that causes all errors to
 **also** be saved to a debug.log log file
 >
 > This means it's not a way to override the logging destination, but to
 write additional copies of the messages in another file.

 Hmm, my interpretation of that is a bit different, I understand that as
 errors being saved in addition to being displayed, not saved to multiple
 files. Perhaps that sentence could be clarified a bit.

 > Looking at `wp-includes/load.php`, this isn't the case. When
 `WP_DEBUG_LOG` is set, it becomes the value of the PHP setting
 `error_log`. However, it required `WP_DEBUG` to be true, which we normally
 don't want/need.

 Indeed, thanks for pointing that out! I missed that `WP_DEBUG_LOG` only
 works if `WP_DEBUG` is enabled.

 > Alternatively, provide a way to change the log file even then `WP_DEBUG`
 is `false`.

 I wonder if we could make `WP_DEBUG_DISPLAY` and `WP_DEBUG_LOG`
 independent of `WP_DEBUG`:
 * `WP_DEBUG_DISPLAY` and `WP_DEBUG_LOG` would always control error
 displaying and log file location, if set.
 * `WP_DEBUG` would then only control the error reporting level.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56035#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list