-
Notifications
You must be signed in to change notification settings - Fork 667
removing/disabling logging #60
Comments
I believe there's 3 instance of logging in the server: failed to connect to server, failed to set previous watches, and a catch all for unexpected errors (which likely point to bigger issues). One alternative is to turn off logging and use exported metrics so that any existing alerting infrastructure can be used (e.g. failed to connect N times in M seconds).. this likely should be added anyway regardless of logging. Do you think it would be ok if you could pass in a custom logger to the client (
and by default the stdlib |
I think that would make sense to me. Then have an unexported struct field for the Logger. To avoid breaking the old way, we could default to setting up a logger that has the same behavior as now. |
By adding this Logger interface, and by fulfilling the interface with a function that has no body, you can silence the log messages from the *zk.Conn instance. The `Connect()` and `ConnectWithDialer()` functions both set the logger up by default to log to `Stderr`. Fixes samuel#60.
By adding this Logger interface, and by fulfilling the interface with a function that has no body, you can silence the log messages from the *zk.Conn instance. The `Connect()` and `ConnectWithDialer()` functions both set the logger up by default to log to `Stderr`. Fixes samuel#60.
I wanted to open an issue for this issue to get feedback before going further and starting to modify the code in preparation for a PR.
When using the library, it log failures and the like by default:
Without setting the writer for all logging to something that isn't stdout, there doesn't appear to be a way to disable this logging. Is there a reason logging was enabled in the library by default?
The text was updated successfully, but these errors were encountered: