This appender creates
a fixed filename “HQ_<
servername>_
hostname_1.log”
as a fixed name and rolls to a second HQ_<
servername>_
hostname_2.log.
When the second file reaches a size of 100MB, it is deleted and HQ_<
servername>_
hostname_1
is renamed to HQ_<
servername>_
hostname_2,
re-creating _1.
<appender class="RollingFileAppender" name="RFA">
<param name="ImmediateFlush" value="true"/>
<param name="Append" value="true"/>
<filter class=”LevelMatchFilter”>
<param name=”LevelToMatch” value=”INFO”/>
<param name=”AcceptOnMatch” value=”TRUE”/>
</filter>
<rollingPolicy class="FixedWindowRollingPolicy">
<param name="fileNamePattern" value="/opt/sasinside/SASConfig/metadata/Lev1
/SASMeta/MetadataServer/Logs/HQ_MetadataServer_%S{hostname}_%i.log"/>
<param name="minIndex" value="1"/>
<param name="maxIndex" value="2"/>
</rollingPolicy>
<triggeringPolicy class="SizeBasedTriggeringPolicy">
<param name="MaxFileSize" value="100MB"/>
</triggeringPolicy>
<layout>
<param name="HeaderPattern" value="Host: '%S{hostname}', OS: '%S{os_family}', Release: '%S{os_release}', SAS Version: '%S{sup_ver_long2}',
Command: '%S{startup_cmd}'"/>
<param name="ConversionPattern" value="%d %-5p [%t] %X{Client.ID}:%u - %m"/>
</layout>
</appender>
This code updates the
root logger to refer to the new appender.
<root>
<level value="Error"/>
<appender-ref ref="TimeBasedRollingFile"/>
<appender-ref ref="IOMServer"/>
<appender-ref ref="RFA"/> <<<<<<<<<<< add this line
</root>