2017-09-04 52 views
0

我有兩個依賴條件,我認爲問題沒有工作。首先我有一個SLF4J https://www.slf4j.org/codes.html#StaticLoggerBinderApache的瓷磚,因爲依賴

來解決問題,通過增加SLF4J的最新版本,我的依賴性看起來像如下:

<dependency> 
    <groupId>org.apache.tiles</groupId> 
    <artifactId>tiles-extras</artifactId> 
    <version>3.0.3</version> 
</dependency> 
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple --> 
<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-simple</artifactId> 
    <version>1.8.0-alpha2</version> 
    <scope>test</scope> 
</dependency> 

但mi標題沒有與頁面比較,現在我沒有任何錯誤,我不知道該怎麼辦。有任何想法嗎?

回答

0

檢查文檔: https://tiles.apache.org/framework/getting_started.html

你需要SLF4J和通用日誌的實現 - 像log4j的。

作爲替代方案,我建議只使用slf4j-simple。這一個依賴關係應該解決您的記錄器需求。

<dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-simple</artifactId> 
     <version>1.7.25</version> 
    </dependency> 

您仍然需要一個log4j prop文件。你可以在我的看看得到的,你應該把它和一個想法:

https://github.com/devaaron/log-prox/blob/master/src/main/resources/log4j.properties

+0

無我有錯誤:沒有發現SLF4J提供商:'SLF4J。 (只有一個)slf4j-nop.jar slf4j-simple.jar,slf4j-log4j12.jar,slf4j-jdk14.jar或者logback-slf4j-log4j12.jar, classic.jar在類路徑上,但我不知道類路徑在哪裏,從哪裏可以拿到這個jar – Adriano