snowflakedb / gosnowflake

Go Snowflake Driver
Apache License 2.0
302 stars 125 forks source link

SNOW-1787174: Move "Authentication FAILED" and "Authentication SUCCESS" to Debug logging #1237

Closed rohantandon closed 2 weeks ago

rohantandon commented 3 weeks ago

What is the current behavior?

Currently, the following lines print an ERROR log and an INFO log when authenticating:

These lines are noisy and should be moved to Debug logging. The authenticate() function already returns an error, which can contain an authentication failure without the need for an error-level log message which can get noisy

What is the desired behavior?

gosnowflake shouldn't issue a log message on successful or failed authentication at the error or info level. These should be debug level.

How would this improve gosnowflake?

This would drastically reduce the noise of the library, which is set to error with no ability for the client to set this. Especially for services like credential rotators, ensuring that an old credential is no longer valid is a pertinent use case, and log messages can quickly accumulate

References, Other Background

sfc-gh-dszmolka commented 2 weeks ago

hi - thanks for raising this.

i'm not entirely sure what

[..]which is set to error with no ability for the client to set this

means in this context of ability to set loglevel. you can use the user-facing Tracing property on Config to configure the desired loglevel (range: trace, debug, info, print, warning, error, fatal, panic), reference , or if that's an option for you, SetLogger to set a customized logger reference

Hope one of them helps in setting up the loglevel in your application which makes the most sense for you.

rohantandon commented 2 weeks ago

Thanks for the pointer to how to change the said log level. I'll look into a fork for the specific log line changes.