Set up JSON-formatted logging
To support JSON logging, you must modify file
log4j2.xml and add a JSONDailyFile logger.
Procedure
- In Guidewire Studio, open file log4j2.xml for editing.
-
Find the
<RollingFile>element for the Daily File Log, for example:<RollingFile name="DailyFileLog" ... > -
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> -
Find the
<Root>element (underneath the<Loggers>element) and add aJSONDailyFileLogentry, for example:<Root level="info"> <AppenderRef ref="Console"/> <AppenderRef ref="DailyFileLog"/> <AppenderRef ref="JSONDailyFileLog"/> </Root>
