0

Application running on Tomcat is using log4j for some unknown reason is appending (randomly) new log lines somewhere in the middle of the log file

log4j.properites looks like:

log4j.rootLogger=INFO, CATALINA
log4j.appender.CATALINA=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.CATALINA.RollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy
log4j.appender.CATALINA.RollingPolicy.FileNamePattern=${catalina.base}/logs/catalina.%d{yyyy-MM-dd}.log
log4j.appender.CATALINA.layout=com.medallies.log.ThreadIdSupportedPatternLayout
log4j.appender.CATALINA.layout.ConversionPattern=[TID=%i] %-5p %d{HH:mm:ss,SSS} | %c | %m%n

Tomcat restart will help in that case but after some time issue will come back.

Any thought on that?

0

Don't know whether this link helps:
https://stackoverflow.com/questions/31828278/using-log4j-in-tomcat-with-different-appenders
the suggestion here is to add a:
log4j.category.WEBAPP=INFO, WEBAPP to your log4j.properties

Myself, I use slf4j which allows for a bunch of different logging frameworks

  • 1
    Nope, that line is not solving the problem – JackTheKnife Apr 4 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.