Selasa, 06 November 2018

Wordpress - Debug.log is not working (SOLVED)


Have you guys ever experience this level when your wordpress debug log is not showing correctly @@"

As i go with Wordpress Framework, here what i found

First Write the files debug.log
in path /wp-content/debug.log
Then Check wp-config.php
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
// @ini_set('display_errors',1);
and if debug still not working, try to check in server side :
<?php phpinfo(); ?>
make sure track_errors is ON

if this still not working, then your only choice is move the error.log to shared folder,
Example : This server is old and does not have the latest configuration. By default, you do not have access to the nginx logs.
So moved the logs to share/logs/<yourwebsites>/* 
and also if you have time , take a look at this gist
https://gist.github.com/franz-josef-kaiser/4063197
Bonus : to track php error in your case directly
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

references :
https://wordpress.stackexchange.com/questions/296942/debug-log-file-is-never-created/301298#301298
https://www.elegantthemes.com/blog/tips-tricks/using-the-wordpress-debug-log

Feeling Helped ? Comment below


EmoticonEmoticon