負載log4j.properties我有以下清單與JAR
Manifest-Version: 1.0
Created-By: 1.7.0_07 (Oracle Corporation)
Main-Class: test.Main
Class-Path: ./log4j.properties lib/log4j-1.2.17.jar
我運行的類如下
java -jar test.jar
一個JAR文件,這是我的文件夾
lib
log4j.properties
test.jar
爲什麼我看不到log4j屬性文件?這是我看到
log4j:WARN No appenders could be found for logger (test.Main).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
謝謝
SOLUTION: 改變了我的classhpath在清單這一
Class-Path: . lib/log4j-1.2.17.jar
Dup的:http://stackoverflow.com/questions/8897528/problems-to-put-log4-properties-classpath – Vadzim