You are not logged in.

#1 2017-04-12 12:33:29

DerJudge
Member
From: NRW, Germany
Registered: 2013-03-26
Posts: 24
Website

Piped Logs in nginx

Hi everyone,

in Apache, there is a "Piped Logs" feature, which makes it possible to write error and access log files through a pipe to another process, rather than directly to a file; it's configured like this:

CustomLog "|/path/to/script param1" common

Is something like that possible with nginx, too?
If so, how? I could not find a mature technique to do this.

Offline

#2 2017-04-12 12:48:02

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Piped Logs in nginx

You could create a named pipe and set nginx to output its logs there.

http://www.linuxjournal.com/article/2156


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-04-12 12:51:34

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,447
Website

Re: Piped Logs in nginx

I second the above.  Nginx does not support piped logs internally (unless it's a relatively new feature).  But named pipes would work - just make sure your listener process starts before nginx.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#4 2017-06-02 20:14:28

DerJudge
Member
From: NRW, Germany
Registered: 2013-03-26
Posts: 24
Website

Re: Piped Logs in nginx

Better late than never: Thank you for our very valuable feedback! Very appreciated! I will either try this or, as a second idea, have rsyslog grab that file and further process through our toolchain.

Offline

Board footer

Powered by FluxBB