Modifying log file count
Use the appropriate namespace;
com.pb.engageone.server.batch
(for accumulated batch), or
com.pb.engageone.server.batch.na
(for NA-Batch) when making
changes in config-settings.xml
configuration file. Refer to the
NA-Batch example
below:
<namespace name="com.pb.engageone.server.batch.na"> . . . .
<setting>
<setting>
<key>log.maxFileCount</key>
<value>10</value>
</setting>
. . . .
</namespace>
To enable this feature, you can either edit the
config-settings.xml
file entries, or override these settings by
adding the maxLogFileCount
parameter, note that this parameter
accepts integer values, i.e. "1", "10", "25", etc.
Example
run-na-batch.bat -dir D:/temp/input1 -domain engageone -deliveryOption
"Batch Print" -maxLogFileCount 10
logback-global.xml
Below is the default configuration for
RollingFileAppender
, you can find this section in
logback-global.xml
file present in <batch bundle
installation folder>/conf/logging
:
<appender name="file-rolling" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>../logs/${contextName}.log</file>
<encoder>
<pattern>[%date | %-5level | %1logger] %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>../logs/${contextName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxHistory>300</maxHistory>
<maxFileSize>10MB</maxFileSize>
</rollingPolicy>
<prudent>true</prudent>
</appender>
Log formatting
The following conversion pattern is used:
[%d{MMM dd HH:mm:ss}]|%-5p|%c|[%t]|%m%n
This pattern ensures that output is delimited by the "|" character if you wish to programmatically process log output files. It also ensures that the fields output by NA batch are as follows:
<TIMESTAMP>|<LOG_LEVEL>|<CLASS_NAME>|<THREAD_NAME>|<INPUT_ANSWER_ID>
|<INPUT_FILE_NAME>|<SPECIFIC_MESSAGE>
An example log message will look like the following:
[Dec 14 15:21:07]|INFO |BatchProgramImpl|[NA Batch Main Thread]|Input
Answer ID: N/A|Input File Name: input_1_record.xml|Done reading xml input file:
D:\dev\EngageOne_1.1\e1DevEnv\e1_installs\202\input\input_1_record.xml