bdunagan

Brian Dunagan

August 27 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');
Dedupe Files with 50 Lines of Ruby Cocoa Tip: NSDate, to the nearest 15 minutes
LinkedIn GitHub Email