Skip to content

Commit 34fd7b6

Browse files
Remove version and levelValue field from logs (#1925)
[static] version is just a constant 1 which is not very useful. levelValue is just a duplicate of level. Signed-off-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org> Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
1 parent 072b83b commit 34fd7b6

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

canton/community/testing/src/test/resources/logback-test.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
2020
<file>${LOG_FILE_NAME:-log/canton_network_test.clog}</file>
2121
<append>${LOG_APPEND:-true}</append>
22-
<encoder class="com.digitalasset.canton.logging.CantonJsonEncoder"/>
22+
<encoder class="com.digitalasset.canton.logging.CantonJsonEncoder">
23+
<fieldNames>
24+
<version>[ignore]</version>
25+
<levelValue>[ignore]</levelValue>
26+
</fieldNames>
27+
</encoder>
2328
</appender>
2429

2530
<!-- Appender for KMS logs -->

scripts/canton-logback.xml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
<if condition='isDefined("LOG_FORMAT_JSON")'>
1313
<then>
1414
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
15-
<encoder class="com.digitalasset.canton.logging.CantonJsonEncoder"/>
15+
<encoder class="com.digitalasset.canton.logging.CantonJsonEncoder">
16+
<fieldNames>
17+
<version>[ignore]</version>
18+
<levelValue>[ignore]</levelValue>
19+
</fieldNames>
20+
</encoder>
1621
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
1722
<level>${LOG_LEVEL_STDOUT:-WARN}</level>
1823
</filter>
@@ -86,7 +91,12 @@
8691
<append>${LOG_FILE_APPEND:-true}</append>
8792
<!-- Allow for disabling flush on each log-line (faster, but may miss logs when crashing) -->
8893
<immediateFlush>${LOG_IMMEDIATE_FLUSH:-true}</immediateFlush>
89-
<encoder class="com.digitalasset.canton.logging.CantonJsonEncoder"/>
94+
<encoder class="com.digitalasset.canton.logging.CantonJsonEncoder">
95+
<fieldNames>
96+
<version>[ignore]</version>
97+
<levelValue>[ignore]</levelValue>
98+
</fieldNames>
99+
</encoder>
90100
<filter class="${log_last_errors_filter}" />
91101
</appender>
92102
</then>
@@ -149,7 +159,12 @@
149159
<!-- keep max 12 archived log files -->
150160
<maxHistory>${LOG_FILE_HISTORY:-12}</maxHistory>
151161
</rollingPolicy>
152-
<encoder class="com.digitalasset.canton.logging.CantonJsonEncoder"/>
162+
<encoder class="com.digitalasset.canton.logging.CantonJsonEncoder">
163+
<fieldNames>
164+
<version>[ignore]</version>
165+
<levelValue>[ignore]</levelValue>
166+
</fieldNames>
167+
</encoder>
153168
<filter class="${log_last_errors_filter}" />
154169
</appender>
155170
</then>

0 commit comments

Comments
 (0)