Advanced Logging Options

<< Click to Display Table of Contents >>

PackBench > 7.3 u1 > User Guide > Advanced Topics 

Advanced Logging Options

Besides the product configuration options that are available from the Settings section of the application UI, there are some additional configuration settings users may adjust to tailor PackBench towards their individual requirements.

Logging PackBench Activity

The program data directory (C:\Users\<username>\AppData\Roaming\RayBench\Logs) is used by default to store the application activity log file ({yyyy-MM-dd HH-mm-ss}.log). If the default settings remain unchanged, PackBench adds a new line to this log file for every system DEBUG level message that is generated during application use.

 

By default, the log is to be used as in a rolling appender manner, which means that one global log file is permanently extended until a certain file size is reached. As soon as it is reached, the oldest lines are automatically transferred into an archive of log files, which is by default limited to 10 files. When this second limit is reached, the oldest archive is removed to free a slot for the newest archive file.

 

In order to change the default settings for the log file behavior, users have to manually edit the log4net.config file, which resides in the root of the installation folder of PackBench (usually something like C:\Program Files (x86)\RayPack\PackBench). The settings which are most likely to be of interest for adjustments are:

 

Log File Storage Location

The log file  is by default “C:\Users\<username>\AppData\Roaming\RayBench\Logs\{yyyy-MM-dd HH-mm-ss}.log”. However, it is possible to define any other absolute local paths as well as shared network locations for logging resource storage.

 

<file type="log4net.Util.PatternString"

        value="%env{AppData}\\PackBench\\Logs\\%date{yyyy-MM-dd HH-mm-ss}.log" />

 

finger1

Be aware:

The user that runs PackBench must have write permissions in the log file location in order to initiate and maintain the message flow to the log file. If the user does not have sufficient access rights, there will be no error message, or actual product usage cutback, but simply a loss of system activity documentation. Please refer to the Troubleshooting section for additional instructions in case of missing logs.

 

Max. Log File Size

The max. log file size may be defined as "KB", "MB" or "GB". The default setting for newly installed PackBench instances is "2048KB"

 

<maximumFileSize value="2048KB" />

 

Log Level

The most frequently used log level settings are DEBUG, INFO, WARN, ERROR, FATAL, OFF, whilst OFF prevents logging at all, FATAL is the most restrictive but still writing setting, and DEBUG the most talkative option.

The recommendation is to use the DEBUG level for newly setup systems, since a lot of the information logged in this mode may help to adjust settings regarding access rights, and the like. As soon as the application and system are up and running productively, setting the log level to WARNING should be sufficient for permanent maintenance.

 

<level value="DEBUG" />

 

Default Logging Configuration

The default configuration file is given below as a review and backup support:

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

 

  <configSections>

    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

  </configSections>

 

  <log4net>

    <appender name="ConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">

      <layout type="log4net.Layout.PatternLayout">

        <conversionPattern value="[%-5p] - %m%n" />

      </layout>

      <threshold value="Info" />

      <mapping>

        <level value="DEBUG" />

        <foreColor value="Yellow" />

      </mapping>

      <mapping>

        <level value="INFO" />

        <foreColor value="White" />

      </mapping>

      <mapping>

        <level value="ERROR" />

        <backColor value="Red, HighIntensity" />

        <foreColor value="White" />

      </mapping>

      <mapping>

        <level value="WARN" />

        <foreColor value="Red" />

      </mapping>

    </appender>

    

    <!--<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >

      <applicationName value="PackBench Service" />

      <layout type="log4net.Layout.PatternLayout">

        <conversionPattern value="%d [%t] %-5p %c - %m%n" />

        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />

      </layout>

    </appender>-->

 

    <appender name="RayBenchFileAppender" type="log4net.Appender.RollingFileAppender">

      <immediateFlush value="true" />

      <file type="log4net.Util.PatternString" value="%property{LogFilePath}\%date{yyyy-MM-dd-HH-mm-ss}.log" />

      <param name="StaticLogFileName" value="false" />

      <maximumFileSize value="10240KB" />

      <rollingStyle value="Once" />

      <maxSizeRollBackups value="2" />

      <layout type="log4net.Layout.PatternLayout,log4net">

        <param name="header" value="/***************************** LOG HEADER *****************************/&#xD;&#xA;" />

        <param name="footer" value="/***************************** LOG FOOTER *****************************/&#xD;&#xA;" />

        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />

      </layout>

      <threshold value="INFO" />

    </appender>

 

    <root>

      <level value="INFO" />

      <appender-ref ref="ConsoleAppender" />

      <appender-ref ref="RayBenchFileAppender" />

      <!--<appender-ref ref="EventLogAppender" />-->

    </root>

  </log4net>

</configuration>

 

Further Information

PackBench uses an external library to provide logging functionality. Please refer to the online-documentation provided for the log4net project (http://logging.apache.org/log4net/) in order to get further details regarding available configuration and usage options. log4net can be adjusted to connect directly with databases or event-loggers. There are numerous options for layout and behavior manipulations. PackBench system administrators with a slight affection for perfection are highly welcome to configure their very own logger version.