tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Hansen <joe.hansen...@gmail.com>
Subject Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory
Date Tue, 04 May 2010 20:44:50 GMT
Thanks Andre and Chuck.

Andre, I renamed Tomcat/abc/ to Tomcat/webapps-abc/ to keep the naming
consistent. The directory structure that you've advocated is exactly
the same as the one Chuck told me. And I have implemented that.

However, logging is still an issue. One webapp's log4j seems to stomp
over other webapp's log files. What could I be doing wrong?

Here are the log4j configuration files:
/* c:\Tomcat\webapps-abc\ROOT\WEB-INF\classes\log4j.properties */
log4j.rootLogger=INFO, A1
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{yyyy MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A1.File=c:/Tomcat/logs/abc.log
log4j.appender.A1.MaxFileSize=100KB
log4j.appender.A1.MaxBackupIndex=4


/* c:\Tomcat\webapps-xyz\ROOT\WEB-INF\classes\log4j.properties */
log4j.rootLogger=INFO, A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{yyyy MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A2.File=c:/Tomcat/logs/xyz.log
log4j.appender.A2.MaxFileSize=100KB
log4j.appender.A2.MaxBackupIndex=4

According to the following link,
http://stackoverflow.com/questions/217929/problem-with-commons-logging-log4j-setup-in-spring-webapp-with-tomcat-6
"If you have multiple webapps on the server, then you'll need
discipline that each webapp's log initialization does not stomp on the
initialization of other webapps. Each webapp will need to use unique
Logger IDs, which can be accomplished with unique package names."

Thank you!
Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message