pipe logfiles to perl script

Igor Sysoev is at rambler-co.ru
Mon Aug 31 18:29:05 MSD 2009

On Mon, Aug 31, 2009 at 03:45:54PM +0200, Miros??aw Jaworski wrote:

> On Mon, 2009-08-31 at 15:07 +0200, Juergen Gotteswinter wrote:
> > Hello Folks,
> > 
> > i am badly looking for a solution to get nginx pipe his logfiles ... 
> > something like cronolog or in my case a special perl script. are there 
> > anyy solutions or patches around?
> You can have multiple logs with nginx. Since logs are useful you may
> want to keep present configuration intact. Add another nginx logfile
> dedicated for your script usage and log there exactly what you script
> wants. Make it a a FIFO ( man mknod ) and read it from your script.

Currently nginx opens log files in blocking mode, therefore if script
will not be able to exhaust data from FIFO for some reason, then nginx
will blocks on log writing and will not be able to process requests.
If I will change this to nonblocking mode, then some data may be lost
on the smae terms.

Igor Sysoev

More information about the nginx mailing list