Add rolling files.

This commit is contained in:
Mike 2020-05-05 01:59:28 +02:00
parent 5fc6bc4002
commit fd2293342f
2 changed files with 76 additions and 0 deletions

12
pom.xml
View File

@ -160,6 +160,18 @@
<version>1.18</version> <version>1.18</version>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>3.0.3</version>
</dependency>
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>

View File

@ -7,6 +7,67 @@
</encoder> </encoder>
</appender> </appender>
<appender name="FileDebug" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logging/debug.txt</file>
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator class="ch.qos.logback.classic.boolex.GEventEvaluator">
<expression>
e.level == DEBUG
</expression>
</evaluator>
<OnMismatch>DENY</OnMismatch>
<OnMatch>NEUTRAL</OnMatch>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>logging/debug.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>7</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %level %logger - %msg%n</pattern>
</encoder>
</appender>
<appender name="FileErrors" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logging/errors/runtime.txt</file>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>error</level>
</filter>
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<expression>java.sql.SQLException.class.isInstance(throwable)</expression>
</evaluator>
<OnMatch>DENY</OnMatch>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>logging/errors/runtime.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>7</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %level %logger - %msg%n</pattern>
</encoder>
</appender>
<appender name="FileErrorsSql" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logging/errors/sql.txt</file>
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<expression>java.sql.SQLException.class.isInstance(throwable)</expression>
</evaluator>
<OnMismatch>DENY</OnMismatch>
<OnMatch>NEUTRAL</OnMatch>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>logging/errors/sql.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>7</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %level %logger - %msg%n</pattern>
</encoder>
</appender>
<logger name="io.netty"> <logger name="io.netty">
<level value="info"/> <level value="info"/>
</logger> </logger>
@ -17,5 +78,8 @@
<root level="info"> <root level="info">
<appender-ref ref="Console" /> <appender-ref ref="Console" />
<appender-ref ref="FileDebug" />
<appender-ref ref="FileErrors" />
<appender-ref ref="FileErrorsSql" />
</root> </root>
</configuration> </configuration>