-
Notifications
You must be signed in to change notification settings - Fork 2
/
logback.xml
39 lines (32 loc) · 1.48 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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property scope="context" name="sys" value="${SYS:-UNKNOWN}" />
<property scope="context" name="app" value="${APP:-UNKNOWN}" />
<property scope="context" name="binary" value="${ARTIFACT_ID:-UNKNOWN}" />
<property scope="context" name="group" value="${GROUP_ID:-UNKNOWN}" />
<property scope="context" name="version" value="${VERSION:-UNKNOWN}" />
<property scope="local" name="log.level" value="${LOG_LEVEL:-INFO}" />
<property scope="local" name="appender" value="${LOG_FORMAT:-JSON}" />
<!-- Cf. https://github.com/logstash/logstash-logback-encoder -->
<appender name="JSON" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<timeZone>UTC</timeZone>
<fieldNames>
<!-- cf. #customizing-standard-field-names -->
<logger>category</logger>
<thread>thread</thread>
<level>level</level>
<stackTrace>trace</stackTrace>
</fieldNames>
</encoder>
</appender>
<!-- Copy of the standard SpringBoot log format -->
<appender name="TEXT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="${log.level}">
<appender-ref ref="${appender}" />
</root>
</configuration>