Set up JSON-formatted logging

To support JSON logging, you must modify file log4j2.xml and add a JSONDailyFile logger.

Procedure

  1. In Guidewire Studio, open file log4j2.xml for editing.
  2. Find the <RollingFile> element for the Daily File Log, for example:
    <RollingFile name="DailyFileLog" ... >
  3. Directly underneath the Daily File Log entry, add a <RollingFile> element for JSON logging, for example:
    <RollingFile name="JSONDailyFileLog" fileName="${guidewire.logDirectory}/PolicyCenter.json"
          filePattern="${guidewire.logDirectory}/PolicyCenter.json%d{.yyyy-MM-dd}">
      <JSONLayout eventEol="true" compact="true" properties="true"/>
      <TimeBasedTriggeringPolicy/>
    </RollingFile>
  4. Find the <Root> element (underneath the <Loggers> element) and add a JSONDailyFileLog entry, for example:
    <Root level="info">
      <AppenderRef ref="Console"/>
      <AppenderRef ref="DailyFileLog"/>
      <AppenderRef ref="JSONDailyFileLog"/>
    </Root>