How to configure the size of EM.log?

Document ID : KB000069429
Last Modified Date : 21/09/2018
Show Technical Document Details
Introduction:
 The EM.log is just a redirection of standard out & standard error when the EM is started with EM_HOME/bin/EMCtrl.sh.  Its size is not controlled by any of the log4j properties in the EM properties file so the em.log will grow unlimited.
 
Question:

How to roll Introscope Enterprise Manager Log files including EM.log based on date and size?

Environment:
Application Performance Management from 9.7 awards.
Answer:
These are the properties used To roll the logs by Date.

log4j.appender.logfile=com.wily.org.apache.log4j.DailyRollingFileAppender
log4j.appender.logfile.DatePattern='.'yyyy-MM-dd-HH-mm

To roll the logs by Size:
log4j.appender.logfile=com.wily.org.apache.log4j.RollingFileAppender
log4j.appender.logfile.MaxBackupIndex=4
log4j.appender.logfile.MaxFileSize=200MB

Procedure:

Stop the Introscope Enterprise Manager.Remove all the log files inside logs folder.

 Then set the properties as given below inside IntroscopeEnterpriseManager.properties:

log4j.appender.logfile=com.wily.org.apache.log4j.DailyRollingFileAppender
log4j.appender.logfile.DatePattern='.'yyyy-MM-dd-HH-mm

log4j.appender.logfile=com.wily.org.apache.log4j.RollingFileAppender
log4j.appender.logfile.MaxBackupIndex=4
log4j.appender.logfile.MaxFileSize=100KB

Start the EM and generate log to reach 100KB then look at the log files.

You will see the date appended log file names.

 
Additional Information:

Please note that by rolling over the logs at a smaller size, any problem that comes up may be overwritten quickly.  So please keep this in mind, should you encounter an issue that you need to be troubleshooted, its best to temporarily increase the log file size so that CA Support can quickly ascertain the situation.

See links below for more information: 

By Using "RollingFileAppender"

By Using "DailyRollingFileAppender"