我要去桂林 / Using pl_analyze

我要去桂林

Using pl_analyze

Posted by accesine on 2008-4-7 19:14:06 CST - 0 comments - 0 trackbacks
Installing
sudo gem install production_log_analyzer
Setup
First:

Set up SyslogLogger according to the instructions here:

seattlerb.rubyforge.org/SyslogLogger/

Then:

Set up a cronjob (or something like that) to run log files through pl_analyze.



Using pl_analyze
To run pl_analyze simply give it the name of a log file to analyze.

pl_analyze /var/log/production.log
If you want, you can run it from a cron something like this:

/usr/bin/gzip -dc /var/log/production.log.0.gz | /usr/local/bin/pl_analyze /dev/stdin
Or, have pl_analyze email you (which is preferred, because tabs get preserved):

/usr/bin/gzip -dc /var/log/production.log.0.gz | /usr/local/bin/pl_analyze /dev/stdin -e devnull@robotcoop.com -s "pl_analyze for `date -v-1d "+%D"`"
In the future, pl_analyze will be able to read from STDIN.
Purple theme designed by Livid, this blog is proudly powered by Project Nexus.