Posted By:
alex_kost
Posted On:
Sunday, January 4, 2009 08:40 AM
I have two web applications on one Tomcat server and would like to log each application to the different xxx.log file. Accordingly Log4j manual I can do this, if I will use different file names, but there is a problem. All logs go to the one xxx.log file! What is wrong here and how can I fix it? I use next log4j.properties: log4j.rootLogger=DEBUG, F log4j.appender.F=org.apache.log4j.DailyRollingFileAppender log4j.appender.F.Encoding=UTF-8 log4j.appender.F.File=${catalina.home}/logs/flat.log log4j.appender.F.DatePattern='.'yyyy-MM-dd log4j.appender.F.layout=org.apache.log4j.PatternLayout log4j.appender.F.layout.conversionPattern=%d{ddMMyy HHmmss} %5c{2} %5p %-50m %-18F %-12M:%-4L %t%n
More>>
I have two web applications on one Tomcat server and would like to log each application to the different xxx.log file. Accordingly Log4j manual I can do this, if I will use different file names, but there is a problem. All logs go to the one xxx.log file! What is wrong here and how can I fix it? I use next log4j.properties:
log4j.rootLogger=DEBUG, F
log4j.appender.F=org.apache.log4j.DailyRollingFileAppender
log4j.appender.F.Encoding=UTF-8
log4j.appender.F.File=${catalina.home}/logs/flat.log
log4j.appender.F.DatePattern='.'yyyy-MM-dd
log4j.appender.F.layout=org.apache.log4j.PatternLayout
log4j.appender.F.layout.conversionPattern=%d{ddMMyy HHmmss} %5c{2} %5p %-50m %-18F %-12M:%-4L %t%n
Second application has similar file, except one line
log4j.appender.F.File=${catalina.home}/logs/cbrs.log
The logging result looks like this:
040109 143812 cbrs DEBUG
040109 145937 flat INFO
040109 150530 flat INFO
040109 150719 cbrs INFO
040109 150719 cbrs INFO
<<Less