PROBLEM:
service.log and jms.log growth in Windows
RESOLUTION:
In Windows it is possible to immediately truncate a large Traverse log file by overwriting it with a zero length file. For example, to create such a file and truncate 'service.log':
cd TRAVERSE_HOME\logs
copy NUL empty.txt
copy empty.txt service.log
The following instructions provide an interim solution for Windows users where service.log and jms.log growth continues. These instructions will change the 'jms.log' and 'service.log' files to rotate every hour and maintain 24 copies and subsequently their names will include the time. Once the files with the new naming convention appear, kindly remove the files without the timestamps in their names (service.log and jms.log).
As a precaution, please back up the original file <TRAVERSE_HOME>\etc\logback.xml before proceeding through these steps.
-For jms.log, find the following lines:
<!-- appender to record activity related to jms clients -->
<appender name="FILEjms" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOGDIR}/jms.log</File>
<encoder>
<pattern>%d{ISO8601} %c{2}[%t]: \(%p\) %m%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${LOGLEVEL}</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<maxIndex>2</maxIndex>
<FileNamePattern>${LOGDIR}/jms.log.%i</FileNamePattern>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>10MB</MaxFileSize>
</triggeringPolicy>
</appender>
-Replace those lines with the following:
<!-- appender to record activity related to jms clients -->
<appender name="FILEjms" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>%d{ISO8601} %c{2}[%t]: \(%p\) %m%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${LOGLEVEL}</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${LOGDIR}/jms-%d{yyyy-MM-dd-HH}.log</FileNamePattern>
<maxHistory>24</maxHistory>
</rollingPolicy>
</appender>
-For service.log, find the following lines
<!-- appender to record activity at backend web service/database layer -->
<appender name="FILEservice" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOGDIR}/service.log</File>
<encoder>
<pattern>${LOGPATTERN}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${LOGLEVEL}</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<maxIndex>2</maxIndex>
<FileNamePattern>${LOGDIR}/service.log.%i</FileNamePattern>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>10MB</MaxFileSize>
</triggeringPolicy>
</appender>
-Replace those lines with the following:
<!-- appender to record activity at backend web service/database layer -->
<appender name="FILEservice" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>${LOGPATTERN}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${LOGLEVEL}</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${LOGDIR}/service-%d{yyyy-MM-dd-HH}.log</FileNamePattern>
<maxHistory>24</maxHistory>
</rollingPolicy>
</appender>
APPLIES TO:
All versions of Traverse