bdunagan

fill the void - bdunagan

27 Aug 2010
WordPress Tip: Debug Logging

Today, I needed a debug log for Wordpress. Luckily, the Wordpress Codex details just a couple lines of code to turn on error logging. This method is especially nice for hosted environments like DreamHost, where there’s no access to php.ini. Simply add the following to wp-config.php:

# http://codex.wordpress.org/Editing_wp-config.php#Debug
define('WP_DEBUG', true);
# http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Log
@ini_set('log_errors','On');
@ini_set('display_errors','Off');
@ini_set('error_log',dirname(__FILE__).'/logs/php_error.log');
Previous LinkedIn Twitter GitHub Email Next