-
Notifications
You must be signed in to change notification settings - Fork 5
/
logback.xml
40 lines (35 loc) · 1.44 KB
/
logback.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<configuration debug="false">
<!-- prevent per-message overhead for jul logging calls, e.g. Hornet -->
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level - %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="MAIN" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/myapp.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logs/myapp_%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>72</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level - %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="JSON" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/myapp_json.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logs/myapp_json_%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>72</maxHistory>
</rollingPolicy>
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
</appender>
<logger name="myapp" level="INFO"/>
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="MAIN"/>
<appender-ref ref="JSON"/>
</root>
</configuration>