I have two web applications on one Tomcat server and would like to log each
application into the separate “xxx.log” file. Accordingly Log4j manual I can
do this, if I will use different file names, but I have a problem. Both logs
go to the same “xxx.log” file! Usually to the last one, that was active.
What is wrong in my log4j.properties?

First application properties:
<code>
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
</code>
Second application properties:
<code>
log4j.rootLogger=DEBUG, F
log4j.appender.F=org.apache.log4j.DailyRollingFileAppender
log4j.appender.F.Encoding=UTF-8
log4j.appender.F.File=${catalina.home}/logs/cbrs.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
</code>

The logging result in my case looks like this:
<code>
040109 143812  cbrs DEBUG …
040109 145937  flat  INFO …
040109 150530  flat  INFO …
040109 150719  cbrs  INFO …
040109 150719  cbrs  INFO …
</code>

-- 
View this message in context: 
http://www.nabble.com/One-.log-file-for-two-different-applications-tp22159737p22159737.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to