-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make logging configurable #44
Comments
Sure, that makes a lot of sense. But please note: you really /should/ be pooling connections. Particularly with the proxy, dialing new database connections is significantly less efficient than using existing connections. |
I could submit a pull request if you can tell me which logging library you would like to use. |
As for what library to use, I would prefer to continue using the standard
logging library in Go. But, it'd be best to abstract it so that users of
the Go library can swap in their own favorite logging library if they feel
like it.
My initial thought is to create a new package `
github.com/GoogleCloudPlatform/cloudsql-proxy/log` which contains exported
variables `Infof`, `Verbosef`, etc which simply forward to the stdlib's
`log.Infof`. In the main file, a "--verbose" flag should be defined, and an
init function should overwrite the definition of `log.Verbosef` to first
check the flag value and then drop the log if the flag is false.
|
Thanks, will submit a PR soon |
@Carrotman42 Can you tell me if the current interface suits you? I'm pretty sure it would be compatible with most logging libraries. Just give me a clear and I'll replace references to the stdlib logger in the entire repo |
@olivierboucher sorry I didn't see your comment from a day ago, and I'm also not exactly sure which interface you mean. After receiving #100 I went ahead and made the changes I suggested in #44 (comment). This will be sent out later today. |
Setting -verbose=false will now turn off the new/closed connection logs. Note that errors which are not EOF will still be logged when in non-verbose mode since these may be useful for debugging client-/server-side problems. Those who would like to disable all output can use the -quiet flag submitted in #100 |
Clarify App Engine usage in the README. This messaging change was previously made in the dockerfile error message, but missed in the README.
When using the proxy with PHP (and no persistent connections) the chattiness of the proxy logs is overwhelming. Since I am running the proxy on Container Engine, those logs are being shipped to Cloud Logging and the amount of "new connection" and "connection closed" messages is significant.
It would be nice to disable logging of new and closed connections.
The text was updated successfully, but these errors were encountered: