将 apache kafka 的 log4j 桥接到 slf4j 之类的
Bridging log4j for apache kafka to slf4j in akka
不确定为什么我无法将 log4j 消息从 apache kafka 0.8.1.1 桥接到 akka 应用程序中的 slf4j。
log4j:WARN No appenders could be found for logger (kafka.utils.VerifiableProperties).
log4j:WARN Please initialize the log4j system properly.
sbt 依赖项:
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion withSources() withJavadoc(),
"org.apache.kafka" %% "kafka" % "0.8.1.1" exclude("javax.jms", "jms") exclude("com.sun.jdmk", "jmxtools") exclude("com.sun.jmx", "jmxri") withSources() withJavadoc(),
"org.slf4j" % "log4j-over-slf4j" % "1.7.5",
"ch.qos.logback" % "logback-classic" % "1.0.13",
我在 logback 中定义了根记录器并且 akka 应用程序记录正常但是我无法通过 apache kafka 的日志?无双重绑定等
我是不是忽略了什么?
感谢
从 kafka 依赖项中排除 log4j 解决了我的类似问题。
libraryDependencies += "org.apache.kafka" % "kafka_2.11" % "0.8.2.0" exclude("log4j", "log4j") exclude("org.slf4j","slf4j-log4j12")
sbt 依赖项
"org.apache.kafka" % "kafka_2.11" % "0.8.2.0" exclude("log4j", "log4j") exclude("org.slf4j","slf4j-log4j12"),
"org.slf4j" % "log4j-over-slf4j" % "1.7.5"
不确定为什么我无法将 log4j 消息从 apache kafka 0.8.1.1 桥接到 akka 应用程序中的 slf4j。
log4j:WARN No appenders could be found for logger (kafka.utils.VerifiableProperties).
log4j:WARN Please initialize the log4j system properly.
sbt 依赖项:
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion withSources() withJavadoc(),
"org.apache.kafka" %% "kafka" % "0.8.1.1" exclude("javax.jms", "jms") exclude("com.sun.jdmk", "jmxtools") exclude("com.sun.jmx", "jmxri") withSources() withJavadoc(),
"org.slf4j" % "log4j-over-slf4j" % "1.7.5",
"ch.qos.logback" % "logback-classic" % "1.0.13",
我在 logback 中定义了根记录器并且 akka 应用程序记录正常但是我无法通过 apache kafka 的日志?无双重绑定等
我是不是忽略了什么?
感谢
从 kafka 依赖项中排除 log4j 解决了我的类似问题。
libraryDependencies += "org.apache.kafka" % "kafka_2.11" % "0.8.2.0" exclude("log4j", "log4j") exclude("org.slf4j","slf4j-log4j12")
sbt 依赖项
"org.apache.kafka" % "kafka_2.11" % "0.8.2.0" exclude("log4j", "log4j") exclude("org.slf4j","slf4j-log4j12"),
"org.slf4j" % "log4j-over-slf4j" % "1.7.5"