Forum Stats

  • 3,838,749 Users
  • 2,262,397 Discussions
  • 7,900,750 Comments

Discussions

log4j Rotation is updating multiple application log files *.log *.log.1 *.log.2...etc

Muralish
Muralish Member Posts: 14 Green Ribbon

Hi,

Java log4j log rotation is updating the logs in multiple log files at the same time as below in screen shot marked in red.

Ideally the log should go only in the eBondingApplication.log file and once its reached the defined maxfile size i.e. 100MB it should rotate/move the *.log file to *.log.1.

But its behaving incorrectly.

could you please let me know the root cause for this issue and the steps to resolve the issue. Thanks.

Note: MaxFileSize and MaxBackupIndex values were 1000MB and 5 respectively, so 2 days ago i changed the file size to 100MB and backupindex to 50. But the issue is still not resolved.

java -version

java version "1.6.0_181"

Java(TM) SE Runtime Environment (build 1.6.0_181-b10)

Java HotSpot(TM) Server VM (build 20.181-b10, mixed mode)

Weblogic version: 10.3.3

log4j.properties file:

log4j.appender.App=org.apache.log4j.RollingFileAppender

log4j.appender.App.File=./logs/eBondingApplication.log

log4j.appender.App.MaxFileSize=100MB

log4j.appender.App.MaxBackupIndex=50

log4j.appender.App.layout=org.apache.log4j.PatternLayout

log4j.appender.App.layout.ConversionPattern=%d{dd.MM. HH:mm:ss,SSS} %-5p %c{3}: %m%n

application log rotation files:

pastedImage_3.png