1
In my application I use the log4j library to generate the logs of the whole system. It is working correctly, I use the following settings:
Direct log messages to a log file
log4j.appender.file=org.apache.log4j.Dailyrollingfileappender log4j.appender.file.File=log/application.log log4j.appender.file.Datepattern='. 'yyyy-MM-dd log4j.appender.file.layout=org.apache.log4j.Patternlayout log4j.appender.file.layout.Conversionpattern=%d{dd-MM-yyyy,HH:mm:ss:SSS},%t,%-5p,%c{1}:%L-%m%n log4j.appender.file.Maxfilesize=50KB log4j.appender.file.Maxhistory=2
I would like to know if there is any property that erases old files that are already more than a week old, because if my system is running for a long time it is impractical to occupy a lot of memory, because the application I am developed is to be used on very old machines.
Is there a solution for this? I added the Maxfilesize and Maxhistory properties and it didn’t work.
Use Dailyrollingfileappender and I made my own implementation. Thank you @utluiz
– fymoribe