forked from CodelyTV/scala-ddd-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logback.xml
26 lines (23 loc) · 1 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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="stdOut" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
%highlight([%level]) [%date{HH:mm:ss.SSS}] [%class{0}#%method:%line] %message \(%mdc\) %n%throwable
</pattern>
</encoder>
</appender>
<appender name="jsonFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>var/log/app_log.json</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>var/log/app_log-%d{yyyy-MM-dd}.gz</fileNamePattern>
<maxHistory>10</maxHistory>
</rollingPolicy>
<encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>
<logger name="ch.qos.logback" level="WARN"/>
<root level="all">
<appender-ref ref="stdOut"/>
<appender-ref ref="jsonFile"/>
</root>
</configuration>