Welcome! Log In Create A New Profile

Advanced

Re: ngx_stream_log_module log_format not working

Francis Daly
March 17, 2019 04:48AM
On Sun, Mar 17, 2019 at 01:21:32AM -0400, yuy wrote:

Hi there,

> I am trying to enable access log for stream on 1.15.9-1~xenial but
> log_format definition doesn't seem to work. Config syntax check fails as if
> stream log_format was not defined

The error reports that "proxy" is unknown on line 3.

You use "proxy" on line 3, and define it from line 4.

> stream{
>
> access_log /var/log/nginx/stream.access.log proxy;
> log_format proxy '$remote_addr [$time_local] '
> '$protocol $status $bytes_sent $bytes_received '
> '$session_time "$upstream_addr" '
> '"$upstream_bytes_sent" "$upstream_bytes_received"
> "$upstream_connect_time"';
> ...
> }

Switch the order of those directives and it should work.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

ngx_stream_log_module log_format not working

yuy March 17, 2019 01:21AM

Re: ngx_stream_log_module log_format not working

Francis Daly March 17, 2019 04:48AM

Re: ngx_stream_log_module log_format not working

CCS March 18, 2019 07:25AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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