EEM server logs are configured out of the box to save 10MB worth of data plus one additional file with older data.
This document refers to a configuration that helps in configuring EEM to rollover a given component's log file on a daily basis and keeps the old ones.
Release : 11.3.6
Component :
1) Backup existing EIAM_HOME/config/logger/server.xml file first
2) Edit the original file and look for section:
<appender name="server" class="org.apache.log4j.RollingFileAppender">
<!-- The active sdk log file -->
<param name="file" value="${EIAM_HOME}/logs/server.log" />
<param name="append" value="true" />
<param name="BufferedIO" value="false"/>
<param name="maxFileSize" value="10000KB" />
<param name="maxBackupIndex" value="1" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The log message pattern -->
<param name="ConversionPattern" value="%5p %d{ISO8601} [%t] [%c] %m%n"/>
</layout>
</appender>
3) Modify that entry to look like:
<appender name="server" class="org.apache.log4j.DailyRollingFileAppender">
<!-- The active sdk log file -->
<param name="file" value="${EIAM_HOME}/logs/server.log" />
<param name="append" value="true" />
<param name="BufferedIO" value="false"/>
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The log message pattern -->
<param name="ConversionPattern" value="[%p] %d %c %M - %m%n" />
</layout>
</appender>
4) The above is for server.log, you can make similar changes for other appenders in that file, example, audit.log appender looks like:
<appender name="audit" class="org.apache.log4j.RollingFileAppender">
<!-- The security audit log file -->
<param name="file" value="${EIAM_HOME}/logs/audit.log" />
<param name="append" value="true" />
<param name="BufferedIO" value="false"/>
<param name="maxFileSize" value="10000KB" />
<param name="maxBackupIndex" value="1" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The log message pattern -->
<param name="ConversionPattern" value="%m%n"/>
</layout>
</appender>
Change that to :
<appender name="audit" class="org.apache.log4j.DailyRollingFileAppender">
<!-- The active sdk log file -->
<param name="file" value="${EIAM_HOME}/logs/audit.log" />
<param name="append" value="true" />
<param name="BufferedIO" value="false"/>
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The log message pattern -->
<param name="ConversionPattern" value="[%p] %d %c %M - %m%n" />
</layout>
</appender>
NOTE: server.xml has several other appenders (similar to audit / server above). They can be modified in a similar way as above. Make sure to use correct appender names, or else the file content will get mixed up.
5) Save the file
6) Restart iGateway
Once the date rolls over to next day, EIAM_HOME\logs\<appender>.log for today gets renamed to yesterday's date like: server.log.2021-10-05. Current entries will get written to server.log
If the configuration is not working for some reason, roll back the change to server.xml and restart EEM to revert to default configuration