there is a mod_log_mysql equivalent in nginx?

mike mike503 at gmail.com
Sun Mar 1 01:02:25 MSK 2009


Hmm
http://snippets.aktagon.com/snippets/247-Logging-nginx-to-remote-loghost-with-syslog-ng-

Is a neat idea, but I would think with hundreds of requests per second
coming from what could be multiple servers that the syslog daemon
would eventually become so busy that you'd miss legitimate messages
too.

I wonder if you could setup two syslog instances?

Right now I do this:

log_format traffic
'$http_host|$bytes_sent|$time_local|$remote_addr|$request_uri';
access_log /var/log/nginx/traffic traffic;

Then I have a nightly cronjob which goes to each server, scps the file
locally, parses them and essentially combines them in the process
(since I have multiple webservers) and then can do statistics on them.
I actually don't load the entire thing into SQL either (I used to)

This is the script I run once a night at like 12:30am, it seems to
give me good enough metrics:
http://mikehost.com/~mike/tmp/runstats.php.txt

Ideally something like a syslog to catch all the servers might be even
better but I'm worried the load on a syslog daemon...
On Sat, Feb 28, 2009 at 6:53 AM, Nick Pearson <nick.pearson at gmail.com> wrote:
> You may find some help in this thread from about three weeks back:
> http://thread.gmane.org/gmane.comp.web.nginx.english/9602
>
> On Sat, Feb 28, 2009 at 8:35 AM, jeffs <jeffs at speakeasy.net> wrote:
>>
>> In apache there is a mod_log_mysql, which will log apache log files to
>> MySQL?
>>
>> Is there a method to do this with nginx?
>>
>> If not, before I install, how can an administrator log the log files in
>> nginx to a database?
>>
>> thank you.
>>
>
>

mm





More information about the nginx mailing list