You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-12-01 22:51:45 +02:00
Allow Logging to stdout with separate Error Log Channel (#718)
* Add dedicated error logging writer * Document new errors to stdout flag * Update changelog * Thread-safe the log buffer * Address feedback * Remove duplication by adding log level * Clean up error formatting * Apply suggestions from code review Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
This commit is contained in:
6
main.go
6
main.go
@@ -38,13 +38,13 @@ func main() {
|
||||
legacyOpts := options.NewLegacyOptions()
|
||||
err = options.Load(*config, flagSet, legacyOpts)
|
||||
if err != nil {
|
||||
logger.Printf("ERROR: Failed to load config: %v", err)
|
||||
logger.Errorf("ERROR: Failed to load config: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
opts, err := legacyOpts.ToOptions()
|
||||
if err != nil {
|
||||
logger.Printf("ERROR: Failed to convert config: %v", err)
|
||||
logger.Errorf("ERROR: Failed to convert config: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ func main() {
|
||||
validator := NewValidator(opts.EmailDomains, opts.AuthenticatedEmailsFile)
|
||||
oauthproxy, err := NewOAuthProxy(opts, validator)
|
||||
if err != nil {
|
||||
logger.Printf("ERROR: Failed to initialise OAuth2 Proxy: %v", err)
|
||||
logger.Errorf("ERROR: Failed to initialise OAuth2 Proxy: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user