0
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SAVEQUERIES', true);

these are lines from my wp-config.php file. What I expect now, that I can view a log file after I click around on my site. I don't find anything, especially no debug.log file in wp-contents. Is there anything else I have to do?

1

The debug log will only capture PHP-generated errors as well as things you manually send yourself. So if it is not being created right now, then there are no warnings/errors being generated by PHP right now.

In order to send things manually, you use error_log(). One quick note though is that you have to set echo to true if you use functions like print_r() to dump out arrays and such to see the actual contents, otherwise you'll just get a 1 so you'll want something like:

error_log( '--- $_POST ---' . PHP_EOL );
error_log( print_r( $_POST, true ) );
error_log( '--- End $_POST ---' . PHP_EOL );

This way you have some landmarks you can search for in the log. PHP_EOL is a constant that simply inserts \n for you so the log will have a line break.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.