Closed PilgrimOfNegentropy closed 2 years ago
This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.
This issue was closed because it has been inactive for 3 days since being marked as stale.
Set system property to use slf4j:
-Drocketmq.client.logUseSlf4j=true
org.apache.rocketmq.remoting.netty.NettyLogger#initNettyLogger
method sets theInternalLoggerFactory#defaultFactory
toorg.apache.rocketmq.remoting.netty.NettyLogger.NettyBridgeLoggerFactory
overridingio.netty.util.internal.logging.Slf4JLoggerFactory
NettyBridgeLoggerFactory
produces loggers whoseisEnabled(InternalLogLevel internalLogLevel)
method is:it returns false when the argument
internalLogLevel
is not greaterEqual thanERROR
becauseorg.apache.rocketmq.remoting.netty.NettyLogger#nettyLogLevel
isERROR
and it has no accessor so it's value is never changedio.netty.handler.logging.LoggingHandler
usesInternalLoggerFactory
to create loggers. Thus if it's initialized after the rocketmq client initialization, it creates aorg.apache.rocketmq.remoting.netty.NettyLogger.NettyBridgeLogger
instead ofSLF4J
's. Thus it never prints logs underERROR
level.I inspected the
4.9.2
version ofrocketmq-client
, it's the same code.