-
Notifications
You must be signed in to change notification settings - Fork 5
/
logback.xml
70 lines (60 loc) · 2.16 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- <<<=== USER CONFIGURABLE PROPERTIES ===>>> -->
<!-- ===>>> GENERAL <<<=== -->
<property name="LOG_PATTERN"
value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{48} [%file:%line] - %message%n" />
<!--
<property name="LOG_PATTERN"
value="%d{HH:mm:ss.SSS} [%thread] %-5level \(%file:%line\) - %msg%n" />
-->
<!-- ===>>> CONSOLE <<<=== -->
<property name="STDOUT_LOG_LEVEL" value="${stdout_level:-WARN}" />
<!-- ===>>> FILES <<<=== -->
<property name="LOG_NAME" value="stucco-scheduler" />
<property name="LOG_LEVEL" value="DEBUG" />
<!-- <<<== END USER CONFIGURABLE PROPERTIES ==>>> -->
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${STDOUT_LOG_LEVEL}</level>
</filter>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- This log file is redundant if logstash is working -->
<appender name="file"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${LOG_LEVEL}</level>
</filter>
<file>${LOG_NAME}.log</file>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_NAME}.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>5</maxHistory>
</rollingPolicy>
</appender>
<!-- Logs only errors in a separate file -->
<appender name="errfile"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<file>${LOG_NAME}-errors.log</file>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_NAME}-errors.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>10</maxHistory>
</rollingPolicy>
</appender>
<root level="all">
<appender-ref ref="stdout" />
<appender-ref ref="file" />
<appender-ref ref="errfile" />
</root>
</configuration>