fix logback config

fix logback config (cf. https://logback.qos.ch/codes.html#nested_if_element)
This commit is contained in:
Adrian-Devries
2024-12-19 15:42:54 +01:00
committed by GitHub
parent 1e57af5a6f
commit 1ccfa39dae

View File

@@ -1,38 +1,36 @@
<configuration> <configuration>
<appender name="STDERR"
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender"> class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target> <target>System.err</target>
<encoder> <encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder> </encoder>
</appender> </appender>
<if condition='property("FILE_APPENDER_ENABLED").contains("true")'>
<if condition='property("FILE_APPENDER_ENABLED").contains("true")'> <then>
<then> <appender name="FILE"
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender" > class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--<appender name="FILE" class="org.mustangproject.commandline.LazyRollingFileAppender" >--> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- Daily rollover -->
<!-- Daily rollover --> <fileNamePattern>log/ZUV-%d{yyyy-MM}.log</fileNamePattern>
<fileNamePattern>log/ZUV-%d{yyyy-MM}.log</fileNamePattern> <!-- Keep 5 years worth of history -->
<maxHistory>60</maxHistory>
<!-- Keep 5 years worth of history --> </rollingPolicy>
<maxHistory>60</maxHistory> <encoder>
</rollingPolicy> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
<encoder> </appender>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </then>
</encoder> </if>
</appender> <!-- Configure so that it outputs to both console and log file -->
</then> <if condition='property("FILE_APPENDER_ENABLED").contains("true")'>
</if> <then>
<root level="INFO">
<!-- Configure so that it outputs to both console and log file --> <appender-ref ref="FILE"/>
<root level="INFO"> </root>
<if condition='property("FILE_APPENDER_ENABLED").contains("true")'> </then>
<then> </if>
<appender-ref ref="FILE" /> <root level="INFO">
</then> <appender-ref ref="STDERR"/>
</if> </root>
<appender-ref ref="STDERR" /> </configuration>
</root>
</configuration>