github issue:
https://github.com/grpc/grpc-java/issues/3033
other guy problem
https://www.rune-server.ee/programming/application-development/665121-how-can-i-disable-nettys-debug-messages.html
我也遇到了同样的问题:
16:50:13.569 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
16:50:13.572 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent - Platform: MacOS
16:50:13.574 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
16:50:13.574 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0 - Java version: 15
16:50:13.576 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
16:50:13.576 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
16:50:13.577 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
16:50:13.579 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable
找了很多办法都解决不了
log4j.properties:
logging.properties:
load:
用properties来配置是没有用的
**
最终解决办法
**
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>
<!-- https://logback.qos.ch/manual/appenders.html#AsyncAppender -->
<!-- AsyncAppender will drop events of level TRACE, DEBUG and INFO if its queue is 80% full -->
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE-ROLLING" />
<!-- defaulr 256 -->
<queueSize>512</queueSize>
</appender>
<logger name="com.mkyong" level="info" additivity="false">
<appender-ref ref="ASYNC"/>
<appender-ref ref="CONSOLE"/>
</logger>
<root level="info">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
这样就可以把多余的netty log 删掉 最终结果: