-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
In a scenario where both redis lettuce and rocketmq are used, lettuce (redis lettuce's log) is output in rocketmq_client.log, these are different components and netty is used at the same time. #14039
Comments
Sounds like a problem with how you configured your logs, and not a Netty issue. |
This feels like it has something to do with the InternalLoggerFactory encapsulation, both rocketmq and redis have InternalLoggerFactory to facade the logs, could this be the cause of the log write errors? This is not an issue when configured separately. |
Do any of them call |
The logging framework used in the lettuce component io.lettuce.core.protocol.ConnectionWatchdog is declared by the netty component io.netty.util.internal.logging.InternalLoggerFactory and instantiated io.netty.util.internal.logging.InternalLogger, configuring log4j2.xml can only affect the log output of io.lettuce.core.protocol, but not io.lettuce.core.protocol. ConnectionWatchdog, how do Io.netty.util.internal.logging.
|
The logger.debug within the ConnectionWatchdog file is unaffected by the log4j2.xml configuration and is output to rocketmq_client.log in applications that also use rocketmq. Can you help explain how the output location is set? Here we are using io.netty.util.internal.logging.InternalLogger, version: netty-common-4.1.38.Final |
Currently looking at using io.netty.util.internal.logging.InternalLogger logs are not controlled by logj4.xml, netty's log output is logback?Is there some kind of fantastic relationship here? |
Netty has a dependency to slf4j, which is a facade, not a logger implementation. |
OK, thanks, this side see is based on slf4j implementation of the log facade, the programme introduced log4j-slf4j-impl, but my program currently still have the above situation, only lettuce-core this part of the implementation can not be log4j2.xml management. |
Because netty-common depends on logback-classic 1.2.13, the class StaticLoggerBinder in logback-classic implements LoggerFactoryBinder and binds logback as a slf4j implementation, so as long as you reference this version of the netty-common, it will use logback as the logging implementation by default, is this the reason?
|
Expected behavior
redis opens the topology, introduces lettuce, and also uses rocketmq, rocketmq_client.log logs only the logs of the rocketmq component.
Actual behavior
Actually rocketmq_client.log records the lettuce log as follows:
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] channelActive()
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] channelActive()
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] channelActive()
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] channelActive()
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] channelActive()
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] channelActive()
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] userEventTriggered(ctx, io.lettuce.core.ConnectionEvents$Activated@1358e27d)
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] userEventTriggered(ctx, io.lettuce.core.ConnectionEvents$Activated@1358e27d)
2024-05-06 16:25:23,023 DEBUG io.lettuce.core.protocol.ConnectionWatchdog - [channel=0xe7773456, /10.8.0.27:57227 -> 172.17.48.140/172.17.48.140:6379, last known addr=172.17.48.140/172.17.48.140:6379] userEventTriggered(ctx, io.lettuce.core.ConnectionEvents$Activated@1358e27d)
Steps to reproduce
lettuce-core:5.1.7.RELEASE
spring-data-redis:2.1.9.RELEASE
spring-boot-starter-data-redis:2.2.13.RELEASE
rocketmq-acl:4.6.0
rocketmq-client:4.6.0
rocketmq-common:4.6.0
rocketmq-logging:4.6.0
rocketmq-remoting:4.6.0
rocketmq-spring-boot:2.1.0
rocketmq-spring-boot-starter:2.1.0
rocketmq-srvutil:4.6.0
Minimal yet complete reproducer code (or URL to code)
Netty version
4.1.36.Final.jar
JVM version (e.g.
java -version
)JDK:java version "1.8.0_321"
OS version (e.g.
uname -a
)Darwin frank 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 arm64
The text was updated successfully, but these errors were encountered: