Tôi có một file jar như sau Manifesttải log4j.properties với 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
tôi chạy lớp như sau
java -jar test.jar
Và đây là thư mục của tôi
lib
log4j.properties
test.jar
Tại sao tôi không thể thấy tệp thuộc tính log4j? Đây là những gì tôi nhìn thấy
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.
Cảm ơn bạn
SOLUTION: thay đổi classhpath tôi trong MANIFEST đến file
Class-Path: . lib/log4j-1.2.17.jar
Dup: http://stackoverflow.com/questions/8897528/problems-to-put-log4-properties-classpath – Vadzim