I am currently using the log4j-1.2.16.jar for my logging purpose in my application.
My requirement is to create a file with some tracking logs of the events occurred in my application, create a backup log file every hour and use that log file for monitoring.
As default by using DatePattern we can create a backup log file every hour, and its working pretty good for me.
But the problem occurs only when the logging event doesn't occur.
The backup file is not getting created.until the logging event occurs in the next hour. The previous data is still in the original logging file which is not rolling by itself.
Is there any possibility that the file gets rolled over irrespective of logging event.
Even if the application is idle for 2 days the file should get rolled over every hour.
while searching i came across an appender which is org.apache.log4j.appender.TimeAndSizeRollingAppender which supports only for log4j-1.2.15.jar
So i downloaded, updated my dependency to 1.2.15 and updated my configuration file as below.
Even if declared its getting rolled only when log event occurs.
Kindly help me in this issue.
Thanks in Advance.
Do you pee on your compost? Does this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop