I'm build a Portlet application deployed to a WebSphere Portal Server running on Linux. Every Portlet WAR uses Log4j for logging with a configuration like this, having every WAR two Log files:
log4j.logger.im.the.package=DEBUG, InfoAppender, DebugAppender
log4j.appender.InfoAppender=org.apache.log4j.RollingFileAppender
log4j.appender.InfoAppender.Threshold=INFO
log4j.appender.InfoAppender.File=/tmp/infoWARName.log
log4j.appender.InfoAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.InfoAppender.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.appender.DebugAppender=org.apache.log4j.RollingFileAppender
log4j.appender.DebugAppender.Threshold=DEBUG
log4j.appender.DebugAppender.File=/tmp/debugWARName.log
log4j.appender.DebugAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.DebugAppender.layout.ConversionPattern=%d %p [%c] - %m%n
After deployment, everything works like charm and log files started filling. After some hours, and at the same time, the Logging stops and info.log
and debug.log
aren't updated at all. We need to redeploy the Portlet WAR in the server to get the logging starting again.
Any ideas?
Update:
I'm starting to suspect it has to do with my Logging JARS. Currently, this are the JAR's inside my WEB-INF/lib
folder:
com.springsource.org.apache.commons.logging-1.1.1.jar
com.springsource.org.apache.log4j-1.2.15.jar
com.springsource.slf4j.api-1.5.6.jar
slf4j-log4j12-1.5.6.jar
Second Update:
At hours from the bounty to end, this is how Log4j is configured in every Portlet Application. Here's web.xml
:
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:miAppLog4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
And miAppLog4j.properties
file is located in folder external to the WAR and to the Portal. We made it availbale in Portlet Classpath through a Shared Library in WebSphere Portal.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…