mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-10-18 04:41:19 +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:
co-authored by
Joel Speed
parent
33e04cc52f
commit
d69fd6af22
@@ -176,7 +176,7 @@ func splitCookie(c *http.Cookie) []*http.Cookie {
|
||||
return []*http.Cookie{c}
|
||||
}
|
||||
|
||||
logger.Printf("WARNING: Multiple cookies are required for this session as it exceeds the 4kb cookie limit. Please use server side session storage (eg. Redis) instead.")
|
||||
logger.Errorf("WARNING: Multiple cookies are required for this session as it exceeds the 4kb cookie limit. Please use server side session storage (eg. Redis) instead.")
|
||||
|
||||
cookies := []*http.Cookie{}
|
||||
valueBytes := []byte(c.Value)
|
||||
|
||||
@@ -121,7 +121,7 @@ func buildStandaloneClient(opts options.RedisStoreOptions) (Client, error) {
|
||||
if opts.CAPath != "" {
|
||||
rootCAs, err := x509.SystemCertPool()
|
||||
if err != nil {
|
||||
logger.Printf("failed to load system cert pool for redis connection, falling back to empty cert pool")
|
||||
logger.Errorf("failed to load system cert pool for redis connection, falling back to empty cert pool")
|
||||
}
|
||||
if rootCAs == nil {
|
||||
rootCAs = x509.NewCertPool()
|
||||
@@ -133,7 +133,7 @@ func buildStandaloneClient(opts options.RedisStoreOptions) (Client, error) {
|
||||
|
||||
// Append our cert to the system pool
|
||||
if ok := rootCAs.AppendCertsFromPEM(certs); !ok {
|
||||
logger.Printf("no certs appended, using system certs only")
|
||||
logger.Errorf("no certs appended, using system certs only")
|
||||
}
|
||||
|
||||
opt.TLSConfig.RootCAs = rootCAs
|
||||
|
||||
Reference in New Issue
Block a user