Configuring the eiPlatform to Automatically Clean Up Old Log Files
As you have seen, by default the logging configuration will create a new log file each day and will not delete old files. However, it can be configured to clean up old log files. To do that, you will need the custom logger class in the attached zip, and the logConfig.xml configuration file that is also in the attached zip.
- Unzip the attached Log4jCleaningLogger.zip file.
- Copy the log4jDailyRollingFileAppenderWithCleanup.jar file into “C:\Program Files\PilotFish Technology\eiPlatform Windows\runtime\”.
- Backup the existing logConfig.xml file in “C:\Program Files\PilotFish Technology\eiPlatform Windows\” and replace it with the logConfig.xml file from the zip file.
- Restart the eiPlatform service.
This will configure the eiPlatform to only keep the log files from the last 7 days. To change it to 5 days, edit the logConfig.xml file and on lines 17 and 18 change the maximumLogFiles and maximumLogDays settings from 7 to 5.
Feel free to contact PilotFish support if you need any assistance.