@@ -30,6 +30,7 @@ import (
3030// or Config File
3131type Options struct {
3232 ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy_prefix" env:"OAUTH2_PROXY_PROXY_PREFIX"`
33+ PingPath string `flag:"ping-path" cfg:"ping-path" env:"OAUTH2_PROXY_PING_PATH"`
3334 ProxyWebSockets bool `flag:"proxy-websockets" cfg:"proxy_websockets" env:"OAUTH2_PROXY_PROXY_WEBSOCKETS"`
3435 HTTPAddress string `flag:"http-address" cfg:"http_address" env:"OAUTH2_PROXY_HTTP_ADDRESS"`
3536 HTTPSAddress string `flag:"https-address" cfg:"https_address" env:"OAUTH2_PROXY_HTTPS_ADDRESS"`
@@ -103,9 +104,8 @@ type Options struct {
103104 StandardLoggingFormat string `flag:"standard-logging-format" cfg:"standard_logging_format" env:"OAUTH2_PROXY_STANDARD_LOGGING_FORMAT"`
104105 RequestLogging bool `flag:"request-logging" cfg:"request_logging" env:"OAUTH2_PROXY_REQUEST_LOGGING"`
105106 RequestLoggingFormat string `flag:"request-logging-format" cfg:"request_logging_format" env:"OAUTH2_PROXY_REQUEST_LOGGING_FORMAT"`
106− PingPath string `flag:"ping-path" cfg:"ping_path" env:"OAUTH2_PROXY_PING_PATH"`
107− SilencePingLogging bool `flag:"silence-ping-logging" cfg:"silence_ping_logging" env:"OAUTH2_PROXY_SILENCE_PING_LOGGING"`
108107 ExcludeLoggingPath string `flag:"exclude-logging-path" cfg:"exclude_logging_path" env:"OAUTH2_PROXY_EXCLUDE_LOGGING_PATH"`
108+ SilencePingLogging bool `flag:"silence-ping-logging" cfg:"silence_ping_logging" env:"OAUTH2_PROXY_SILENCE_PING_LOGGING"`
109109 AuthLogging bool `flag:"auth-logging" cfg:"auth_logging" env:"OAUTH2_PROXY_LOGGING_AUTH_LOGGING"`
110110 AuthLoggingFormat string `flag:"auth-logging-format" cfg:"auth_logging_format" env:"OAUTH2_PROXY_AUTH_LOGGING_FORMAT"`
111111 SignatureKey string `flag:"signature-key" cfg:"signature_key" env:"OAUTH2_PROXY_SIGNATURE_KEY"`
@@ -136,6 +136,7 @@ type SignatureData struct {
136136func NewOptions() *Options {
137137 return &Options{
138138 ProxyPrefix: "/oauth2",
139+ PingPath: "/ping",
139140 ProxyWebSockets: true,
140141 HTTPAddress: "127.0.0.1:4180",
141142 HTTPSAddress: ":443",
@@ -168,7 +169,6 @@ func NewOptions() *Options {
168169 LoggingLocalTime: true,
169170 LoggingCompress: false,
170171 ExcludeLoggingPath: "",
171− PingPath: "/ping",
172172 SilencePingLogging: false,
173173 StandardLogging: true,
174174 StandardLoggingFormat: logger.DefaultStandardLoggingFormat,
@@ -572,11 +572,16 @@ func setupLogger(o *Options, msgs []string) []string {
572572 logger.SetStandardEnabled(o.StandardLogging)
573573 logger.SetAuthEnabled(o.AuthLogging)
574574 logger.SetReqEnabled(o.RequestLogging)
575− logger.SetExcludePath(o.ExcludeLoggingPath)
576575 logger.SetStandardTemplate(o.StandardLoggingFormat)
577576 logger.SetAuthTemplate(o.AuthLoggingFormat)
578577 logger.SetReqTemplate(o.RequestLoggingFormat)
579578
579+ if o.SilencePingLogging {
580+ logger.SetExcludePath(o.PingPath)
581+ } else {
582+ logger.SetExcludePath(o.ExcludeLoggingPath)
583+ }
584+
580585 if !o.LoggingLocalTime {
581586 logger.SetFlags(logger.Flags() | logger.LUTC)
582587 }