我正在運行一個shell腳本來執行一個Java程序。調用java程序,當我路過log4j配置文件沒有得到加載
-Dlog4j.configuration=${SRD_BATCH_HOME}/propertyfile/log4j.properties
當我運行該程序,我看到日誌
log4j: Trying to find [/some path/log4j.properties] using context classloader
[email protected]此之上。 log4j:嘗試使用[email protected]類加載器查找[/ some path/log4j.properties]。 log4j:嘗試使用ClassLoader.getSystemResource()查找[/ some path/log4j.properties]。 log4j:找不到資源:[/ some path/log4j.properties]。
但我的log4j的是在這個地方//log4j.properties
我在java程序添加BasicConfigurator.configure()
右側臥和日誌開始打印,但現在它的打印一切,它不是在看我的屬性文件。有人可以幫助解決這裏可能出現的問題。
可能的複製http://stackoverflow.com/a/12579674/603516 – Vadzim