Jan 9, 2009

nginx, Analog stats, LOGFORMAT

Currently, I'm using nginx web server for the Checkvist project. And have the following definition for the access log format (from The Rails Way book):
    log_format  main  '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

Today I decided to create a quick and dirty statistics report for the checkvist.com using Analog. The problem was, that the log format used by nginx is not recognizable by Analog by default - one have to tweak LOGFORMAT option.

If you are in the same situation, here is the LOGFORMAT I use:
LOGFORMAT (%S - %u [%d/%M/%Y:%h:%n:%j %j] %j %r %j "%c" %b "%f" "%B" %j)
May be this will help someone :).


No comments: