-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Suppress unnecesssary internal info logs from clientconn.go #3918
Comments
These messages seem to meet the published standards for INFO log-level messages here: https://github.com/grpc/grpc-go/blob/master/Documentation/log_levels.md#info Perhaps you want to disable grpc info logs instead? |
There is no easy way to disable "info" logs for gRPC. The user needs to create a custom logger to discard those newly appeared logs. It would also be nice if we can provide an easy way to do so. |
If you have an existing logger: type MyInfoSinkLogger struct {
grpclog.LoggerV2 // Embed the primary logger
}
func (MyInfoSinkLogger) Info(...) { } // Override Info funcs
func (MyInfoSinkLogger) Infoln(...) { } // to nops, so Info logs
func (MyInfoSinkLogger) Infof(...) { } // are ignored. If not, you can use https://godoc.org/google.golang.org/grpc/grpclog#NewLoggerV2: grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, <warning writer>, <error writer>) |
I forgot to mention: info logs are off by default for the default logger, and are only enabled by setting the environment variable |
Currently these logs are enabled by default in glogger which doesn't check |
As part of the component logging #3617, we wanted to make this configurable per-module in addition to globally. This feature still needs to be designed, but we should do that instead of adding knobs to the glogger (which isn't really recommended for most users since it parses command-line flags). |
Let's call this a dupe of the new issue I made to track the above, #3937. |
What did you do?
Run gRPC codelab.
What did you expect to see?
Clean log.
What did you see instead?
Unnecessary logs were dumped by default.
Note those logs weren't there by default before the import on 02/19.
Do we want to support verbosity level for internal logs or provide an easy way to disable those info logs?
The text was updated successfully, but these errors were encountered: