Automated log management for RSA Mobile
2 years ago
Originally Published: 2004-01-19
Article Number
000061745
Applies To
RSA Mobile 1.5 Authentication Server
RSA Mobile 1.5
Microsoft Windows 2000
Sun Solaris
Issue
Automated log management for RSA Mobile
Log file keeps growing
Cause
RSA Mobile uses the log4j facility to log the variety of events and actions which occur inside RSA Mobile. For full details of what log4j offers visit http://logging.apache.org/log4j/docs/ and https://www.qos.ch/shop/products/log4j/log4j-Manual.jsp
Resolution
Some customization is available to enable automatic management of the log files produced. The default action is that all events are continuously appended into the file called <BASEDIR>/log/RSAEvent.log. The following steps show how a log file may be configured which is switched out at the start of each day.

The configuration of this logging can be found in the file <BASEDIR>/properties/AuditLogConfig.xml, where there will be a block of data that looks as shown below:

       <!-- This appender will store RSA Events into a flat file. If the    -->
       <!-- value of the File parameter is not a full or relative pathname, -->
       <!-- the event log file will be stored in the working directory.     -->
       <appender name="EventFile" class="org.apache.log4j.FileAppender">
               <errorHandler class="com.rsa.log4j.RSAErrorHandler"/>
               <!-- Customizable log file location. -->
               <param name="File" value="../../log/RSAEvent.log" />
               <!-- Use PatternLayout for formatting. -->
               <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern"
                         value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
               </layout>
       </appender>

To have the log file switched each day, replace the entire block of code with the following:

       <!-- This appender will store RSA Events into a flat file. If the    -->
       <!-- value of the File parameter is not a full or relative pathname, -->
       <!-- the event log file will be stored in the working directory.     -->
       <appender name="EventFile" class="org.apache.log4j.DailyRollingFileAppender">
               <errorHandler class="com.rsa.log4j.RSAErrorHandler"/>
               <!-- Customizable log file location. -->
               <param name="File" value="../../log/RSAEvent.log" />
                    <param name="DatePattern" value=".yyyy-MM-dd" />
               <!-- Use PatternLayout for formatting. -->
               <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern"
                         value="%d %-5p - %m%n"/>
               </layout>
       </appender>

NOTE: The log switch does not occur at midnight. It occurs when the next event occurs, which might for example not be until 6:00 a.m. the next morning.