Oauth2-proxy: All logs going to stderr

Created on 3 Apr 2020  路  6Comments  路  Source: oauth2-proxy/oauth2-proxy

All logs should log to stdout by default


Currently all logging is going to stderr




Steps to Reproduce (for bugs)

  • Download oauth2_proxy binary from github
  • Write to oauth2_proxy.cfg
    http_address = "http://127.0.0.1:5180" request_logging = true cookie_secret = "foo" client_id = "foo" client_secret = "foo" email_domains = [ "foo.com" ]
  • ./oauth2_proxy -config=oauth2_proxy.cfg > /dev/null
    [2020/04/02 20:48:27] [oauthproxy.go:261] OAuthProxy configured for Google Client ID: foo [2020/04/02 20:48:27] [oauthproxy.go:267] Cookie settings: name:_oauth2_proxy secure(https):true httponly:true expiry:168h0m0s domain: path:/ samesite: refresh:disabled [2020/04/02 20:48:27] [http.go:92] HTTP: listening on 127.0.0.1:5180 127.0.0.1 - - [2020/04/02 20:48:57] 127.0.0.1:5180 GET - "/ping" HTTP/1.1 "curl/7.58.0" 200 2 0.000 127.0.0.1 - - [2020/04/02 20:48:59] 127.0.0.1:5180 GET - "/ping" HTTP/1.1 "curl/7.58.0" 200 2 0.000 127.0.0.1 - - [2020/04/02 20:49:00] 127.0.0.1:5180 GET - "/ping" HTTP/1.1 "curl/7.58.0" 200 2 0.000

Notice everything is going out stderr and not stdout


Context

The reason this is important is our syslog logging systems that read from our docker containers then assume log lines coming our stderr are ERROR log level when this are just INFO and not something we need to pay attention to

Your Environment

oauth2_proxy-v5.1.0.linux-amd64.go1.14 binary

  • Version used:

5.1.0

enhancement help wanted high-priority

All 6 comments

Most likely just a single line change here https://github.com/oauth2-proxy/oauth2-proxy/blob/master/pkg/logger/logger.go#L101 to os.Stdout,

Ideally the project would still write errors to stderr, though I don't think our logging currently has the ability to distinguish errors from info logs, might need more than just a one line change, but I'm open to a PR to fix this

This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed.

This is still relevant, I think we should try to implement this

This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed.

I'd still like to see this fixed at some point

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sneko picture sneko  路  3Comments

christidis picture christidis  路  7Comments

max-wittig picture max-wittig  路  4Comments

apeschel picture apeschel  路  5Comments

NickMeves picture NickMeves  路  6Comments