-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Too Many Logs #3033
Comments
Those are DEBUG-level logging, which is the most verbose logging. I can't really know where you have configuration that is enabling that level of logging, but the default is INFO. |
Strange..... I don't think I'm setting the logging level anywhere in my app. I've tried adding this to turn them off. Logger log = Logger.getlogger("io.grpc"); Is there something else I can do? |
@cvkumar You can explicitly configure the logging settings by specifying a
And telling the JVM to use this file via the flag @ejona86 FWIW, using a fresh download of jdk1.8.0_101 to run the gRPC examples results in similar logging output for me locally as well. |
any clues about this? I have a really hard time to disable the logging and it is super verbose. Maybe the frame logging should be enabled via a config switch instead? I don't seem to have any other debug logs besides that pesky frame logger. |
Feel pretty silly about it, but I haven't found a solution for this either. |
I worked around it by forcing log4j as the logging backend and setting io.netty to INFO. static {
InternalLoggerFactory.setDefaultFactory(Log4JLoggerFactory.INSTANCE);
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig("io.netty");
loggerConfig.setLevel(Level.INFO);
ctx.updateLoggers();
} |
This happens because netty uses SLF4J and it will bind to a logging framework if it exists in your class path. Removing the log output is a 2 step process.
An example of doing this can be found on StackOverflow (the code below is copied from the StackOverflow post). import org.slf4j.impl.StaticLoggerBinder;
// 1. Determine what logging framework SLF4J is bound to:
final StaticLoggerBinder binder = StaticLoggerBinder.getSingleton();
// this will print the name of the logger factory to stdout
System.out.println(binder.getLoggerFactoryClassStr()); |
Please answer these questions before submitting your issue.
What version of gRPC are you using?
1.0.0
What JVM are you using (
java -version
)?1.8
What did you do?
If possible, provide a recipe for reproducing the error.
Not sure.
What did you expect to see?
No logs.
What did you see instead.
I am pretty new to using grpc-java so this might be a very basic issue. When I run my code I receive extensive logging (seen above). So much so that it has crashed my IDE before. I have tried to follow the thread here:
#1577
Logger log = Logger.getlogger("io.grpc");
log.setLevel(Level.WARNING);
Unfortunately, I have had no success. Has anyone else seen this issue or know of a solution?
The text was updated successfully, but these errors were encountered: