Hi all,
Is there a general recommendation on creating a custom logback.xml file for usage in a Canton application during production?
I’d like to implement a custom encoder pattern without missing out on any information which might be required for debugging in the event of an error.
Referencing the default logback.xml normally used by Canton, I notice that certain information such as
- tid
- context
- err-context
are defined in the entityentityCorrelationIdTrailingSpaceReplace
within the logback.xml file as seen below:
<!ENTITY entityCorrelationIdTrailingSpaceReplace "%replace(tid:%mdc{trace-id} ){'tid: ', ''}- %msg%replace(, context: %marker){', context: $', ''}%replace( err-context:%mdc{err-context} ){' err-context: ', ''}%n"> ]>
Question:
Would utilizing the entityCorrelationIdTrailingSpaceReplace
entity in a custom encoder pattern be sufficient to ensure complete capture of information relevant for Canton troubleshooting purposes in all Canton nodes (Participant, Sequencer, Mediator and Domain-manager)?
Are there any additional configurations that have to be included in the custom logback.xml file?
The main goal is to ensure that all important debugging information is captured within the produced operation logs.
Example of intended custom logback appender:
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>log/${canton-node}-log.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>logback-${canton-node}.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>10GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern> %d{"yyyy-MM-dd'T'HH:mm:ss,SSSXXX",UTC} [%logger{10}] &entityCorrelationIdTrailingSpaceReplace; [%thread] %level [%file:%line] -%kvp- %msg%n</pattern>
</encoder>
</appender>
Thank you