@@ -9,7 +9,6 @@ import (
99 oidc "github.com/coreos/go-oidc"
1010 ipapi "github.com/oauth2-proxy/oauth2-proxy/pkg/apis/ip"
1111 sessionsapi "github.com/oauth2-proxy/oauth2-proxy/pkg/apis/sessions"
12− "github.com/oauth2-proxy/oauth2-proxy/pkg/logger"
1312 "github.com/oauth2-proxy/oauth2-proxy/providers"
1413 "github.com/spf13/pflag"
1514)
@@ -183,24 +182,7 @@ func NewOptions() *Options {
183182 UserIDClaim: "email",
184183 InsecureOIDCAllowUnverifiedEmail: false,
185184 SkipOIDCDiscovery: false,
186− Logging: Logging{
187− ExcludePaths: "",
188− LocalTime: true,
189− SilencePing: false,
190− AuthEnabled: true,
191− AuthFormat: logger.DefaultAuthLoggingFormat,
192− RequestEnabled: true,
193− RequestFormat: logger.DefaultRequestLoggingFormat,
194− StandardEnabled: true,
195− StandardFormat: logger.DefaultStandardLoggingFormat,
196− File: LogFileOptions{
197− Filename: "",
198− MaxSize: 100,
199− MaxAge: 7,
200− MaxBackups: 0,
201− Compress: false,
202− },
203− },
185+ Logging: loggingDefaults(),
204186 }
205187}
206188
@@ -283,24 +265,6 @@ func NewFlagSet() *pflag.FlagSet {
283265 flagSet.Bool("redis-use-cluster", false, "Connect to redis cluster. Must set --redis-cluster-connection-urls to use this feature")
284266 flagSet.StringSlice("redis-cluster-connection-urls", []string{}, "List of Redis cluster connection URLs (eg redis://HOST[:PORT]). Used in conjunction with --redis-use-cluster")
285267
286− flagSet.String("logging-filename", "", "File to log requests to, empty for stdout")
287− flagSet.Int("logging-max-size", 100, "Maximum size in megabytes of the log file before rotation")
288− flagSet.Int("logging-max-age", 7, "Maximum number of days to retain old log files")
289− flagSet.Int("logging-max-backups", 0, "Maximum number of old log files to retain; 0 to disable")
290− flagSet.Bool("logging-local-time", true, "If the time in log files and backup filenames are local or UTC time")
291− flagSet.Bool("logging-compress", false, "Should rotated log files be compressed using gzip")
292−
293− flagSet.Bool("standard-logging", true, "Log standard runtime information")
294− flagSet.String("standard-logging-format", logger.DefaultStandardLoggingFormat, "Template for standard log lines")
295−
296− flagSet.Bool("request-logging", true, "Log HTTP requests")
297− flagSet.String("request-logging-format", logger.DefaultRequestLoggingFormat, "Template for HTTP request log lines")
298− flagSet.String("exclude-logging-paths", "", "Exclude logging requests to paths (eg: '/path1,/path2,/path3')")
299− flagSet.Bool("silence-ping-logging", false, "Disable logging of requests to ping endpoint")
300−
301− flagSet.Bool("auth-logging", true, "Log authentication attempts")
302− flagSet.String("auth-logging-format", logger.DefaultAuthLoggingFormat, "Template for authentication log lines")
303−
304268 flagSet.String("provider", "google", "OAuth provider")
305269 flagSet.String("provider-display-name", "", "Provider display name")
306270 flagSet.String("oidc-issuer-url", "", "OpenID Connect issuer URL (ie: https://accounts.google.com)")
@@ -326,5 +290,7 @@ func NewFlagSet() *pflag.FlagSet {
326290
327291 flagSet.String("user-id-claim", "email", "which claim contains the user ID")
328292
293+ flagSet.AddFlagSet(loggingFlagSet())
294+
329295 return flagSet
330296}