2014-10-27 32 views
0

我試圖讓SLF4J綁定到logback,但它是默認Log4j。SLF4J即使在不存在綁定的情況下也會默認爲Log4j

我擁有所有爲logback配置的默認配置文件,以及綁定。

我的類路徑中有以下相關的罐子:

的logback經典 共享記錄(99.0 - 不 - 不存在)//空罐子排除共享記錄的logback 核心 的logback-外部 - 彈簧

注意:否log4j依賴關係存在。

這是一個春天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(試圖用它作爲彈簧監聽器),但有或沒有這個jar問題依然存在。

任何幫助表示讚賞,謝謝。

回答

0

您的依賴關係中可能有一個具有log4j依賴性。你需要排除它。 試着看看父母。

+0

mvn dependency:tree | grep「log4j」什麼也不返回。我已經刪除了每個log4j依賴關係。 – 2014-10-27 16:23:44

+0

你確定項目內部沒有JAR可能被Log4j意外包裹了嗎? – Ahiel 2014-10-28 06:07:14

相關問題