In my application I use the log4j library to generate system-wide logs. 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 deletes the old files that already have more than a week, because if my system stays running for a long time it is not possible to occupy much memory, because the application that I am developed is to be used on very old machines.
Is there any solution to this? I added the MaxFileSize and MaxHistory properties and it did not work.