According to the documentation cited below I should be able to add a path to save the debug.log at but it does not seem to be working for me.


define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' );

in wp-config.php I have:

define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' );
define( 'WP_DEBUG_DISPLAY', false );

The log keeps saving to the default location instead. Any help as too why this would not behave as expected is appreciated.

Running WP Version 5.0.8 With WordFence installed

  • What is the default location? Have you confirmed that location is actually writable? If you have access to /tmp is there a reason you don't just use the normal PHP error log? – Tom J Nowell Mar 14 at 1:29
  • The default save location as specified in the documentation is wp-content/debug.log and it keeps saving there even when specifying other locations. the /tmp/wp-error.log used above is the sample given in the doc. I have also tried /wp-content/custom-path/debug.log with no success including WP_CONTENT_DIR . '/custom-path/debug.log' in case it need the full path. So those location should be writable even if tmp was not. – upsDuck Mar 17 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.