@@ -30,6 +30,7 @@ import (
30// or Config File
30// or Config File
31type Options struct {
31type Options struct {
32 ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy_prefix" env:"OAUTH2_PROXY_PROXY_PREFIX"`
32 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"`
33 ProxyWebSockets bool `flag:"proxy-websockets" cfg:"proxy_websockets" env:"OAUTH2_PROXY_PROXY_WEBSOCKETS"`
34 ProxyWebSockets bool `flag:"proxy-websockets" cfg:"proxy_websockets" env:"OAUTH2_PROXY_PROXY_WEBSOCKETS"`
34 HTTPAddress string `flag:"http-address" cfg:"http_address" env:"OAUTH2_PROXY_HTTP_ADDRESS"`
35 HTTPAddress string `flag:"http-address" cfg:"http_address" env:"OAUTH2_PROXY_HTTP_ADDRESS"`
35 HTTPSAddress string `flag:"https-address" cfg:"https_address" env:"OAUTH2_PROXY_HTTPS_ADDRESS"`
36 HTTPSAddress string `flag:"https-address" cfg:"https_address" env:"OAUTH2_PROXY_HTTPS_ADDRESS"`
@@ -103,9 +104,8 @@ type Options struct {
103 StandardLoggingFormat string `flag:"standard-logging-format" cfg:"standard_logging_format" env:"OAUTH2_PROXY_STANDARD_LOGGING_FORMAT"`
104 StandardLoggingFormat string `flag:"standard-logging-format" cfg:"standard_logging_format" env:"OAUTH2_PROXY_STANDARD_LOGGING_FORMAT"`
104 RequestLogging bool `flag:"request-logging" cfg:"request_logging" env:"OAUTH2_PROXY_REQUEST_LOGGING"`
105 RequestLogging bool `flag:"request-logging" cfg:"request_logging" env:"OAUTH2_PROXY_REQUEST_LOGGING"`
105 RequestLoggingFormat string `flag:"request-logging-format" cfg:"request_logging_format" env:"OAUTH2_PROXY_REQUEST_LOGGING_FORMAT"`
106 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"`
108 ExcludeLoggingPath string `flag:"exclude-logging-path" cfg:"exclude_logging_path" env:"OAUTH2_PROXY_EXCLUDE_LOGGING_PATH"`
107 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"`
109 AuthLogging bool `flag:"auth-logging" cfg:"auth_logging" env:"OAUTH2_PROXY_LOGGING_AUTH_LOGGING"`
109 AuthLogging bool `flag:"auth-logging" cfg:"auth_logging" env:"OAUTH2_PROXY_LOGGING_AUTH_LOGGING"`
110 AuthLoggingFormat string `flag:"auth-logging-format" cfg:"auth_logging_format" env:"OAUTH2_PROXY_AUTH_LOGGING_FORMAT"`
110 AuthLoggingFormat string `flag:"auth-logging-format" cfg:"auth_logging_format" env:"OAUTH2_PROXY_AUTH_LOGGING_FORMAT"`
111 SignatureKey string `flag:"signature-key" cfg:"signature_key" env:"OAUTH2_PROXY_SIGNATURE_KEY"`
111 SignatureKey string `flag:"signature-key" cfg:"signature_key" env:"OAUTH2_PROXY_SIGNATURE_KEY"`
@@ -136,6 +136,7 @@ type SignatureData struct {
136func NewOptions() *Options {
136func NewOptions() *Options {
137 return &Options{
137 return &Options{
138 ProxyPrefix: "/oauth2",
138 ProxyPrefix: "/oauth2",
139 ProxyWebSockets: true,
140 ProxyWebSockets: true,
140 HTTPAddress: "127.0.0.1:4180",
141 HTTPAddress: "127.0.0.1:4180",
141 HTTPSAddress: ":443",
142 HTTPSAddress: ":443",
@@ -168,7 +169,6 @@ func NewOptions() *Options {
168 LoggingLocalTime: true,
169 LoggingLocalTime: true,
169 LoggingCompress: false,
170 LoggingCompress: false,
170 ExcludeLoggingPath: "",
171 ExcludeLoggingPath: "",
172 SilencePingLogging: false,
172 SilencePingLogging: false,
173 StandardLogging: true,
173 StandardLogging: true,
174 StandardLoggingFormat: logger.DefaultStandardLoggingFormat,
174 StandardLoggingFormat: logger.DefaultStandardLoggingFormat,
@@ -572,11 +572,16 @@ func setupLogger(o *Options, msgs []string) []string {
572 logger.SetStandardEnabled(o.StandardLogging)
572 logger.SetStandardEnabled(o.StandardLogging)
573 logger.SetAuthEnabled(o.AuthLogging)
573 logger.SetAuthEnabled(o.AuthLogging)
574 logger.SetReqEnabled(o.RequestLogging)
574 logger.SetReqEnabled(o.RequestLogging)
575− logger.SetExcludePath(o.ExcludeLoggingPath)
576 logger.SetStandardTemplate(o.StandardLoggingFormat)
575 logger.SetStandardTemplate(o.StandardLoggingFormat)
577 logger.SetAuthTemplate(o.AuthLoggingFormat)
576 logger.SetAuthTemplate(o.AuthLoggingFormat)
578 logger.SetReqTemplate(o.RequestLoggingFormat)
577 logger.SetReqTemplate(o.RequestLoggingFormat)
579+ if o.SilencePingLogging {
580+ logger.SetExcludePath(o.PingPath)
582+ logger.SetExcludePath(o.ExcludeLoggingPath)
580 if !o.LoggingLocalTime {
585 if !o.LoggingLocalTime {
581 logger.SetFlags(logger.Flags() | logger.LUTC)
586 logger.SetFlags(logger.Flags() | logger.LUTC)