Ability to separately disable access log in http and stream contexts
Two new configuration options: `disable-http-access-log` `disable-stream-access-log` Should resolve issue with enormous amount of `TCP 200` useless entries in logs Signed-off-by: Andrey Voronkov <voronkovaa@gmail.com>
This commit is contained in:
parent
46cca5ad40
commit
bced1ed8b8
2 changed files with 13 additions and 4 deletions
|
|
@ -157,10 +157,19 @@ type Configuration struct {
|
||||||
// http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout
|
// http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout
|
||||||
ClientBodyTimeout int `json:"client-body-timeout,omitempty"`
|
ClientBodyTimeout int `json:"client-body-timeout,omitempty"`
|
||||||
|
|
||||||
// DisableAccessLog disables the Access Log globally from NGINX ingress controller
|
// DisableAccessLog disables the Access Log globally for both HTTP and Stream contexts from NGINX ingress controller
|
||||||
//http://nginx.org/en/docs/http/ngx_http_log_module.html
|
// http://nginx.org/en/docs/http/ngx_http_log_module.html
|
||||||
|
// http://nginx.org/en/docs/stream/ngx_stream_log_module.html
|
||||||
DisableAccessLog bool `json:"disable-access-log,omitempty"`
|
DisableAccessLog bool `json:"disable-access-log,omitempty"`
|
||||||
|
|
||||||
|
// DisableHTTPAccessLog disables the Access Log for http context globally from NGINX ingress controller
|
||||||
|
// http://nginx.org/en/docs/http/ngx_http_log_module.html
|
||||||
|
DisableHTTPAccessLog bool `json:"disable-http-access-log,omitempty"`
|
||||||
|
|
||||||
|
// DisableStreamAccessLog disables the Access Log for stream context globally from NGINX ingress controller
|
||||||
|
// http://nginx.org/en/docs/stream/ngx_stream_log_module.html
|
||||||
|
DisableStreamAccessLog bool `json:"disable-stream-access-log,omitempty"`
|
||||||
|
|
||||||
// DisableIpv6DNS disables IPv6 for nginx resolver
|
// DisableIpv6DNS disables IPv6 for nginx resolver
|
||||||
DisableIpv6DNS bool `json:"disable-ipv6-dns"`
|
DisableIpv6DNS bool `json:"disable-ipv6-dns"`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ http {
|
||||||
default 1;
|
default 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
{{ if $cfg.DisableAccessLog }}
|
{{ if or $cfg.DisableAccessLog $cfg.DisableHTTPAccessLog }}
|
||||||
access_log off;
|
access_log off;
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ if $cfg.EnableSyslog }}
|
{{ if $cfg.EnableSyslog }}
|
||||||
|
|
@ -684,7 +684,7 @@ stream {
|
||||||
|
|
||||||
log_format log_stream '{{ $cfg.LogFormatStream }}';
|
log_format log_stream '{{ $cfg.LogFormatStream }}';
|
||||||
|
|
||||||
{{ if $cfg.DisableAccessLog }}
|
{{ if or $cfg.DisableAccessLog $cfg.DisableStreamAccessLog }}
|
||||||
access_log off;
|
access_log off;
|
||||||
{{ else }}
|
{{ else }}
|
||||||
access_log {{ $cfg.AccessLogPath }} log_stream {{ $cfg.AccessLogParams }};
|
access_log {{ $cfg.AccessLogPath }} log_stream {{ $cfg.AccessLogParams }};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue