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?

JackTheKnife
  • 371
  • 1
  • 6
  • 24

1 Answers1

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

Bill Naylor
  • 101
  • 3