Adds support for disabling the entire access_log

This commit is contained in:
Ricardo Pchevuzinske Katz 2017-02-09 21:20:12 -02:00
parent 2119b23cb8
commit d0c4e0d713
4 changed files with 19 additions and 0 deletions

View file

@ -87,7 +87,11 @@ http {
default 1;
}
{{ if $cfg.DisableAccessLog }}
access_log off;
{{ else }}
access_log /var/log/nginx/access.log upstreaminfo if=$loggable;
{{ end }}
error_log /var/log/nginx/error.log {{ $cfg.ErrorLogLevel }};
{{ buildResolvers $cfg.Resolver }}
@ -424,7 +428,12 @@ stream {
log_format log_stream '$remote_addr [$time_local] $protocol [$ssl_preread_server_name] [$stream_upstream] $status $bytes_sent $bytes_received $session_time';
{{ if $cfg.DisableAccessLog }}
access_log off;
{{ else }}
access_log /var/log/nginx/access.log log_stream;
{{ end }}
error_log /var/log/nginx/error.log;
# configure default backend for SSL