简体   繁体   中英

Tomcat in eclipse ignores log4j.properties

My WebApplication in eclipse uses slf4j for logging. When running my app in tomcat inside eclipse the log4j.properties seems to be ignored, as neither a logfile is created nor my loglevel or logging format is used.

Only inside the tomcat console my logs with loglevel WARN and higher are displayed. I placed the file inside WEB-INF/classes and WEB-INF/lib as suggested in another thread but without success. I also set below arguments in the tomcat server

-Dlog4j.debug=true 
-Dlog4j.configuration="file:/Prgs/apache-tomcat-9.0.17/conf/log4j.properties" 

解决方案是将slf4j-log4j12-1.7.26.jar添加到WEB-INF / lib文件夹中,而不是slf4j-simple-1.7.26.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM