Welcome! Log In Create A New Profile

Advanced

Re: nginx ignores access_log directive when post_action specifie

Maxim Dounin
February 20, 2012 10:20AM
Hello!

On Mon, Feb 20, 2012 at 07:28:52AM -0500, rishabh wrote:

> Hi,
>
> I am trying to log into two files. one default and one custom via
> post_action.
>
> http {
> access_log /var/log/nginx/access.log;
>
> server {
> location @postactionlocation {
> set_by_lua_file $logdata /var/www/log.lua;
> access_log /var/log/nginx/access2.log '$logdata';
> return 444;
> }
>
> location / {
> #someproxypass here
> }
>
> post_action @postactionlocation;
> }
>
>
> In this case only access2.log(via post_action) is written and not the
> default access.log(in http)
>
> What would be an optimal solution.

If you want request to be logged into two logs, you have to define
two access_log directives where requests are logged, i.e.

location / {
access_log /var/log/nginx/access.log;
access_log /var/log/nginx/access2.log;
...
}

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx ignores access_log directive when post_action specifie

Chris Kriebus May 30, 2010 08:32PM

Re: nginx ignores access_log directive when post_action specifie

rishabh February 10, 2012 01:29AM

Re: nginx ignores access_log directive when post_action specifie

Maxim Dounin February 10, 2012 02:32AM

Re: nginx ignores access_log directive when post_action specifie

rishabh February 20, 2012 07:28AM

Re: nginx ignores access_log directive when post_action specifie

Maxim Dounin February 20, 2012 10:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 189
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