Daily File Log Definition

File log4j2.xml defines a default daily file log (DailyFileLog), which is the root logging file for Guidewire PolicyCenter. In the base configuration, the DailyLogFile appender definition is similar to the following:

<Configuration>
  <Appenders>
    <RollingFile name="DailyFileLog" fileName="${guidewire.logDirectory}/pclog.log"
          filePattern="${guidewire.logDirectory}/pclog.log%d{.yyyy-MM-dd}">
      <PatternLayout pattern="${file.defaultPattern}" charset="UTF-8"/>
      <TimeBasedTriggeringPolicy/>
    </RollingFile>
  </Appenders>
</Configuration>

Notice the following:

  • Attribute fileName on <RollingFile> defines the daily log file name. The attribute includes the full directory path that global property guidewire.logDirectory defines.
  • Attribute filePattern on <RollingFile> defines the log file name of the archive backup file. The file name definition contains a variable that PolicyCenter updates every time that it creates a new backup file.
  • Attribute pattern on <PatternLayout> defines the formatting conventions to use in writing information to the log file. In this example, it uses the default formatting defined in property file.defaultPattern.
  • Element <TimeBasedTriggeringPolicy> defines the frequency at which PolicyCenter performs the file rollover process. If not set, as in this case, it defaults to rolling over the log file at midnight each night.
Refer to the following Apache documentation for details of how to use RollingFile appenders and the <TimeBasedTriggeringPolicy> element:

See also