-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathlogback.xml
More file actions
76 lines (70 loc) · 3.29 KB
/
Copy pathlogback.xml
File metadata and controls
76 lines (70 loc) · 3.29 KB
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
71
72
73
74
75
76
<!--
~ Copyright 2019-2024 CloudNetService team & contributors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<configuration>
<import class="ch.qos.logback.classic.filter.ThresholdFilter"/>
<import class="ch.qos.logback.core.rolling.RollingFileAppender"/>
<import class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"/>
<import class="eu.cloudnetservice.node.impl.log.QueuedConsoleLogAppender"/>
<import class="eu.cloudnetservice.node.impl.console.log.ConsoleLogAppender"/>
<import class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"/>
<!-- variables used in the logback configuration. Can be set using system properties. -->
<variable name="cloudnet.log.path" value="${cloudnet.log.path:-local/logs}"/>
<variable name="cloudnet.log.level" value="${cloudnet.log.level:-DEBUG}"/>
<variable name="cloudnet.log.properties.file" value="${cloudnet.log.properties.file:-logback.properties}"/>
<!-- allow configuring log levels using properties file -->
<propertiesConfigurator optional="true" file="${cloudnet.log.properties.file}"/>
<conversionRule conversionWord="levelColor"
class="eu.cloudnetservice.node.impl.console.log.ConsoleLevelConversion"/>
<property name="CONSOLE_PATTERN"
value="%gray([%boldWhite(%d{dd.MM HH:mm:ss.SSS}%gray(]))) %gray(%levelColor(%-5level%gray(:))) %msg%n"/>
<appender name="ConsoleLogAppender" class="ConsoleLogAppender">
<filter class="ThresholdFilter">
<level>INFO</level>
</filter>
<encoder class="PatternLayoutEncoder">
<pattern>${CONSOLE_PATTERN}</pattern>
</encoder>
</appender>
<appender name="QueuedConsoleLogAppender" class="QueuedConsoleLogAppender">
<filter class="ThresholdFilter">
<level>INFO</level>
</filter>
<encoder class="PatternLayoutEncoder">
<pattern>${CONSOLE_PATTERN}</pattern>
</encoder>
</appender>
<appender name="Rolling" class="RollingFileAppender">
<file>${cloudnet.log.path}/latest.log</file>
<rollingPolicy class="SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${cloudnet.log.path}/cloudnet-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>15MB</maxFileSize>
<maxHistory>5</maxHistory>
<totalSizeCap>5GB</totalSizeCap>
</rollingPolicy>
<encoder class="PatternLayoutEncoder">
<pattern>[%d{dd.MM HH:mm:ss.SSS}] %-5level: %msg%n</pattern>
</encoder>
</appender>
<root level="${cloudnet.log.level}">
<appender-ref ref="ConsoleLogAppender"/>
<appender-ref ref="Rolling"/>
<appender-ref ref="QueuedConsoleLogAppender"/>
</root>
<!-- loggers that print information we can't do anything about -->
<logger name="jetbrains.exodus" level="WARN"/>
<logger name="net.schmizz.sshj" level="WARN"/>
<logger name="jetbrains.exodus.io.FileDataWriter" level="OFF"/>
</configuration>