fixes #259: disable file logging by setting system property "disable-file-logging"

This commit is contained in:
Ulrich Zielhofer
2021-12-29 13:28:15 +01:00
parent 9c5fba421d
commit 96097464ec
2 changed files with 29 additions and 20 deletions

View File

@@ -42,6 +42,11 @@
<artifactId>jargs</artifactId> <artifactId>jargs</artifactId>
<version>2.0-SNAPSHOT</version> <version>2.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>3.1.6</version>
</dependency>
<dependency> <dependency>
<groupId>org.riversun</groupId> <groupId>org.riversun</groupId>
<artifactId>bigdoc</artifactId> <artifactId>bigdoc</artifactId>

View File

@@ -5,26 +5,30 @@
<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>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<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 --> <!-- Keep 5 years worth of history -->
<maxHistory>60</maxHistory> <maxHistory>60</maxHistory>
</rollingPolicy> </rollingPolicy>
<encoder> <encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder> </encoder>
</appender> </appender>
<!-- Configure so that it outputs to both console and log file --> <!-- Configure so that it outputs to both console and log file -->
<root level="INFO"> <root level="INFO">
<appender-ref ref="FILE" /> <if condition='!isDefined("disable-file-logging")'>
<then>
<appender-ref ref="FILE" />
</then>
</if>
<appender-ref ref="STDERR" /> <appender-ref ref="STDERR" />
</root> </root>
</configuration> </configuration>