Previous Topic: About the Logger Configuration Files

Next Topic: Appender in eiam.log4net.config

Appender

An appender contains parameters that control the logging of each logger. By default, the logger configuration files contains the following appenders:

SDK

Logs the SDK messages into a log file. Specifies the path including the file name of the log file.

Default: eiam.cppsdk.log for C++ SDK, EIAM.C#SDK.log for C#, and eiam.javasdk.log for Java SDK.

Note: If you are deploying your application under Tomcat server on Windows, verify that you use forward slash '/' in the path instead of the backward slash '\'. If you use backward slash, the log file is not created at the path you have specified; instead, the log file is created in the Apache Tomcat folder.

Network

Logs the network call related messages into a log file.

Default:eiam.network.cpp.log for C++ SDK, EIAM.NETWORK.C#SDK.log for C# SDK, and eiam.javasdk.log for Java SDK.

Performance

Logs the performance call related messages into a log file.

Default: eiam.performance.cpp.log for C++ SDK, EIAM.PERFORMANCE.C#SDK.log for C# SDK, and eiam.performance.java.log

Console

Displays the log messages on the console.

SDK appender is enabled by default. To enable other appenders, remove the comment strings (<!-- and -->) from their respective code.

An appender consists of the following configurable parameters:

file

Specifies the log filename of the appender.

append

Specifies if a set of log messages is appended to the log file. If the value is true, the set of log message is appended to the last log message in the log file.

Note: This parameter is named appendToFile in the eiam.log4net.config file.

BufferedIO

Specifies if the latest log message is buffered. If the value is true, latest few log messages are kept in memory before writing to log file. This option minimizes IO operation and is beneficial if the log level is higher.

Value: [true|false]

Default: false

Note: The default size of BufferedIO is 8 KB.

maxFileSize

Specifies the maximum size of the log file. If a log file exceeds the maximum size, a new log file filename log.1 is created and the contents of log file are transferred to log.1 file. The log file now contains latest log messages. If this file too exceeds the maximum size, a new log file filename log.2 is created, the contents of log.1 are transferred to log.2 file, and the contents of log file are transferred to log.1 file.

Default: 10 MB

Minimum: 10 KB

Maximum: 2 GB

Note: The minimum size of the maxFileSize must be greater than or equal to the size of BufferedIO. This parameter is named maximumFileSize in the eiam.log4net.config file.

maxBackupIndex

Specifies the maximum number of backup log files used for keeping old logs. If the number of log files exceeds the maximum backup index value, the file with the oldest log messages is deleted.

Default: 1

Minimum: 1

Maximum: 12

Note: This parameter is named maxSizeRollBackups in the eiam.log4net.config file.

rollingStyle

Specifies the criteria for creating log files. When this parameter is set to Size, if a log file exceeds the maximumFileSize, a new log file is created and the contents of the current log file are backed up.

Default: Size

Note: This parameter is valid for the eiam.log4net.config file. For more information about the rollingStyle parameter, see the log4net documentation.

ConversionPattern

Specifies the formatting of a log message. Configure the format modifiers and conversion characters to define the conversion pattern.

Note: For more information about conversion patterns, refer the topic log4j in www.apache.org.

Example: SDK Appender

<appender name="SDK" class="org.apache.log4j.RollingFileAppender">
<!-- The active sdk log file -->
<param name="file" value="eiam.cppsdk.log" />
<param name="append" value="true" />
<param name="BufferedIO" value="false"/>
<param name="maxFileSize" value="10000KB" />
<param name="maxBackupIndex" value="1" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The log message pattern -->
<param name="ConversionPattern" value="%5p %d{ISO8601} [%t] [%c] %m%n"/>
</layout>
</appender>