【发布时间】:2014-10-27 15:34:28
【问题描述】:
我正在尝试让 SLF4J 绑定到 logback,但它默认为 Log4j。
我已经为 logback 配置了所有默认配置文件,以及绑定。
我的类路径有以下相关的 jar:
logback-经典 commons-logging (99.0-does-not-exist) //空 jar 以排除 commons-logging logback 核心 logback-ext-spring
注意:不存在 log4j 依赖项。
这是一个 spring mvc 应用程序。
在启动时 SLF4J 有以下输出:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/masierp/Documents/springsource/vfabric-tc-server-developer-2.8.2.RELEASE/blablahbkla/wtpwebapps/ilm-engine/WEB-INF/lib/activemq-all-5.7.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/masierp/Documents/springsource/vfabric-tc-server-developer-2.8.2.RELEASE/blablahbkla/wtpwebapps/ilm-engine/WEB-INF/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
请注意,找到的绑定都不是 log4j 绑定。
我弄乱了 spring-ext(试图将它用作 spring 监听器),但无论有没有这个 jar,问题仍然存在。
任何帮助表示赞赏,谢谢。
【问题讨论】:
标签: java logging log4j slf4j logback