Welcome! Log In Create A New Profile

Advanced

Log to socket?

Posted by Mark 
Log to socket?
November 14, 2011 06:01PM
Can I make Nginx log to a socket?
Re: Log to socket?
November 15, 2011 01:22AM
Ok, it looks like I can emulate it with TCP from info in this old post : http://mailman.nginx.org/pipermail/nginx/2007-June/001069.html


> No, I do not plan to add piped logs.
> However, you can use named pipe (FIFO).
>
> Also you can use the post_action to track downloading:
>
> location /xar/ {
> internal;
>
> root ...;
> post_action /done;
> }
>
> location = /done {
> internal;
>
> fastcgi_pass ...
> fastcgi_param URI $request_uri;
> ....
> }
Re: Log to socket?
November 16, 2011 09:18AM
FYI :

The eventual solution I came up with (for Node.js) is to tail the Nginx access.log instead.

module.exports = child = require('child_process');

var tail = child.spawn("tail", ["-fn0", '/path/to/access.log']);
tail.stdout.on("data", function (data) {
myFuncToHandleAccesses(data.toString('utf8'));
});
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 153
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready