In AutoPilot SU33 and later, AutoPilot uses log4j2. Logging configuration is defined in the log4j2.xml file, located under AUTOPILOT_HOME (for example, /opt/nastel/AutoPilotM6). AP logging is not based on how old a log file is, but instead on the file size and the number (count) of files. But log4j2 does include a deletion action, which deletes files that are older than a certain number of days, and this is triggered when the log file rolls over. Using this technique, it is possible to save logs for a certain number of days.
Before you increase the limit on the number of files that can be saved, it's important to make sure that you have enough disk space on the file system, .
Storing Domain/CEP logs for 7 days
To save Domain/CEP logs for 7 days, update the <DefaultRolloverStrategy> tag, under <RollingFile name="file" to include the delete action and increase the count of files that can be created. (In the example below, this count is set using the variable max=100.)
<DefaultRolloverStrategy max="100" fileIndex="min">
<Delete basePath="${sys:autopilot.home}/logs/log4j" maxDepth="2">
<IfFileName glob="${sys:server.container.name}*.log4j.gz"/>
<IfLastModified age="P7D" />
</Delete>
</DefaultRolloverStrategy>
Storing WGS logs for the last 7 days
To save WGS logs for 7 days, update the <DefaultRolloverStrategy> tag, under <RollingFile name="file_WGSExpert" to include the delete action and increase the count of files that can be created. (In the example below, this count is set using the variable max=1000.)
<DefaultRolloverStrategy max="1000" fileIndex="min">
<Delete basePath="${sys:autopilot.home}/logs/log4j" maxDepth="2">
<IfFileName glob="*_wgs.*.log4j.gz"/>
<IfLastModified age="P7D" />
</Delete>
</DefaultRolloverStrategy>