@@ -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,15 +104,16 @@ 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"`
107+ ExcludeLoggingPaths string `flag:"exclude-logging-paths" cfg:"exclude_logging_paths" env:"OAUTH2_PROXY_EXCLUDE_LOGGING_PATHS"`
108+ SilencePingLogging bool `flag:"silence-ping-logging" cfg:"silence_ping_logging" env:"OAUTH2_PROXY_SILENCE_PING_LOGGING"`
106109 AuthLogging bool `flag:"auth-logging" cfg:"auth_logging" env:"OAUTH2_PROXY_LOGGING_AUTH_LOGGING"`
107110 AuthLoggingFormat string `flag:"auth-logging-format" cfg:"auth_logging_format" env:"OAUTH2_PROXY_AUTH_LOGGING_FORMAT"`
108−
109− SignatureKey string `flag:"signature-key" cfg:"signature_key" env:"OAUTH2_PROXY_SIGNATURE_KEY"`
110− AcrValues string `flag:"acr-values" cfg:"acr_values" env:"OAUTH2_PROXY_ACR_VALUES"`
111− JWTKey string `flag:"jwt-key" cfg:"jwt_key" env:"OAUTH2_PROXY_JWT_KEY"`
112− JWTKeyFile string `flag:"jwt-key-file" cfg:"jwt_key_file" env:"OAUTH2_PROXY_JWT_KEY_FILE"`
113− PubJWKURL string `flag:"pubjwk-url" cfg:"pubjwk_url" env:"OAUTH2_PROXY_PUBJWK_URL"`
114− GCPHealthChecks bool `flag:"gcp-healthchecks" cfg:"gcp_healthchecks" env:"OAUTH2_PROXY_GCP_HEALTHCHECKS"`
111+ SignatureKey string `flag:"signature-key" cfg:"signature_key" env:"OAUTH2_PROXY_SIGNATURE_KEY"`
112+ AcrValues string `flag:"acr-values" cfg:"acr_values" env:"OAUTH2_PROXY_ACR_VALUES"`
113+ JWTKey string `flag:"jwt-key" cfg:"jwt_key" env:"OAUTH2_PROXY_JWT_KEY"`
114+ JWTKeyFile string `flag:"jwt-key-file" cfg:"jwt_key_file" env:"OAUTH2_PROXY_JWT_KEY_FILE"`
115+ PubJWKURL string `flag:"pubjwk-url" cfg:"pubjwk_url" env:"OAUTH2_PROXY_PUBJWK_URL"`
116+ GCPHealthChecks bool `flag:"gcp-healthchecks" cfg:"gcp_healthchecks" env:"OAUTH2_PROXY_GCP_HEALTHCHECKS"`
115117
116118 // internal values that are set after config validation
117119 redirectURL *url.URL
@@ -134,6 +136,7 @@ type SignatureData struct {
134136func NewOptions() *Options {
135137 return &Options{
136138 ProxyPrefix: "/oauth2",
139+ PingPath: "/ping",
137140 ProxyWebSockets: true,
138141 HTTPAddress: "127.0.0.1:4180",
139142 HTTPSAddress: ":443",
@@ -165,6 +168,8 @@ func NewOptions() *Options {
165168 LoggingMaxBackups: 0,
166169 LoggingLocalTime: true,
167170 LoggingCompress: false,
171+ ExcludeLoggingPaths: "",
172+ SilencePingLogging: false,
168173 StandardLogging: true,
169174 StandardLoggingFormat: logger.DefaultStandardLoggingFormat,
170175 RequestLogging: true,
@@ -571,6 +576,14 @@ func setupLogger(o *Options, msgs []string) []string {
571576 logger.SetAuthTemplate(o.AuthLoggingFormat)
572577 logger.SetReqTemplate(o.RequestLoggingFormat)
573578
579+ excludePaths := make([]string, 0)
580+ excludePaths = append(excludePaths, strings.Split(o.ExcludeLoggingPaths, ",")...)
581+ if o.SilencePingLogging {
582+ excludePaths = append(excludePaths, o.PingPath)
583+ }
584+
585+ logger.SetExcludePaths(excludePaths)
586+
574587 if !o.LoggingLocalTime {
575588 logger.SetFlags(logger.Flags() | logger.LUTC)
576589 }