PingAccess

Logging

PingAccess logging is handled by the log4j2 asynchronous logging library. This library is configurable in the conf/log4j2.xml file.

Audit logs are also configurable in conf/log4j2.xml. These logs record a select subset of transaction log information at runtime plus additional details. For more information, see Security Audit Logging.

By default, logging information outputs to PA_HOME/logs/pingaccess.log, and file logging uses the rolling file appender. PingAccess keeps a maximum of 10 log files, each with a maximum size of 100 MB. Once 10 files accumulate, PingAccess deletes the oldest.

Changing defaults

You can change these defaults by locating and modifying the following properties in the <Appenders> section of conf/log4j2.xml:

  • To rename the log file, modify:

    <RollingFile name="File"
                fileName="${sys:pa.home}/log/pingaccess.log"
                filePattern="${sys:pa.home}/log/pingaccess.log.%i"
                ignoreExceptions="false">
  • To set the maximum log size, modify:

    <SizeBasedTriggeringPolicy size="100000 KB"/>
  • To set the maximum number of log files, modify:

    <DefaultRolloverStrategy max="10"/>

exchangeId

In addition to the standard log4j2 items, PingAccess adds a custom item which is usable in the log4j2.xml<PatternLayout> configuration. This custom item, exchangeId, identifies the ID for a specific request-response pair.

For example, the following line from the conf/log4j2.xml file incorporates the exchangeId in the output:

<pattern>%d{ISO8601} %5p [%X{exchangeId}] %c:%L - %m%n</pattern>

The %X conversion character is required to ensure that the exchangeID displays properly.