[wp-hackers] Preferred way to debug / log messages (besides Debug-Bar-Extender)

Brian Layman wp-hackers at thecodecave.com
Mon Apr 16 14:56:05 UTC 2012


I always keep it simple and tail the error log file on the server.  That 
allows you to also see syntax errors that produce a white screen.

Usually that means doing something like:
tail -f /usr/local/apache/logs/error_log

But if I can't find the file on a particular machine I'd add something 
like this to the wp-config file:
@ini_set('log_errors','On');
@ini_set('display_errors','Off');
@ini_set('error_log','/home/example/error_log');

And then that will put most all WordPress related errors and debug 
messages in that one file.

Then you can just call error_log( "Whatever you want" );  to put the 
message out there.

You can filter for specific prefixes in your error messages using grep 
or you can even look for your ip address:
tail -f /home/example/error_log|grep 127.1.2.3

If I'm tailing the error log on a windows PC I use baretail: 
http://www.baremetalsoft.com/baretail/
The free version meets all my needs so far.

Brian Layman


On 4/16/2012 9:13 AM, scribu wrote:
> Last time I tried it FirePHP, you could see the message in-browser, in 
> the Firebug console. 


More information about the wp-hackers mailing list