Configuring the traceability ID in log4j2.xml

Logging configuration file log4j2.xml contains several important elements that you need to configure to work with traceability IDs and markers.

The <Property> element

In the base configuration, Guidewire adds the following code to the <Property name="file.defaultPattern"> element for both traceability ID and marker string formatting. This property defines the default formatting to use in building the names of the log file that PolicyCenter generates on a daily basis.
<Property name="file.defaultPattern"> 
      ${gw:serverId} 
      %-8.24X{userID} 
      %36.36X{traceabilityID}
      %d{yyyy-MM-dd HH:mm:ss,SSS} 
      %p 
      %notEmpty{&lt; %marker &gt;}
      %m
      %n 
</Property>

The <Console> element

In the base configuration, Guidewire adds the following code to the <Console> element for both traceability ID and marker string formatting. The <Console> element defines how PolicyCenter sends logging messages to the application console.

<Console name= "Console" follow= "true">
  <PatternLayout pattern="${gw:serverId} 
        %-8.24X{userID} 
        %36.36X{traceabilityID} 
        %d{yyyy-MM-dd HH:mm:ss,SSS} 
        %p 
        %notEmpty{&lt; %marker &gt;}
        %m
        %n"  
        charset="UTF-8"/>
</Console>