AdminUI :: Log Files : Rotation Configuration

Document ID : KB000049545
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

AdminUI log files called server*.log are growing in the \CA\siteminder\adminui\server\default\log directory.

Could you let me know how I can configure the AdminUI so that a log file doesn't grow indefinitely, and thus, causing potential disk space issues in the future?

Solution:

You should be able to configure log rolling in the jboss-log4j.xml file.

Here is the section of the config file default in SiteMinder r12 SP3:

+++++++++++++++++++++++++++++++++++++
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
 <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler" />
  <param name="File" value="${jboss.server.log.dir}/server.log" />
  <param name="Append" value="false" />
  <param name="DatePattern" value="'.'yyyy-MM-dd" />
  <layout class="org.apache.log4j.PatternLayout">
   <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />
  </layout>
</appender>
 
+++++++++++++++++++++++++++++++++++++

DailyRollingFileAppender is the default and should rotate logs automatically at startup, or daily at midnight. Modifying the appender to create a fixed number of logs and rotate the logs when they reach a specific file size should be straightforward. Here is an example:

++++++++++++++++++++++++++++++++++
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
 <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler" />
  <param name="File" value="${jboss.server.log.dir}/server.log" />
  <param name="Append" value="true" />
  <param name= MaxFileSize  value= 20MB />
  <param name= MaxBackupIndex  value= 10 />
  <param name="DatePattern" value="'.'yyyy-MM-dd" />
  <layout class="org.apache.log4j.PatternLayout">
   <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />
  </layout>
</appender>
 
+++++++++++++++++++++++++++++++++++++

MaxFileSize = Maximum file Size before rolling to a new log
MaxBackupIndex = The number of Log files to retain.

The updated example should retain a maximum of 10 log files and rotate the logs files so no single log file is greater than 20MB. Typically log rolling is considered best practices for most, if not all, applications in a production environment. I am assuming that this would not have an impact on SiteMinder since the logs naturally role at midnight by default anyway.

Please take note that logs are not rolled-over unless there is some activity.

Note also that the maxBackupIndex is not supported by DailyRollingFileAppender, but only by RollingFileAppender.