forked from jdi-testing/jdi-light
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log4j2.xml
77 lines (62 loc) · 3.06 KB
/
log4j2.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
71
72
73
74
75
76
77
<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorInterval="30" status="warn">
<Properties>
<Property name="logFileName">jdiEvents</Property>
<Property name="baseDir">./target/.logs</Property>
</Properties>
<Appenders>
<!-- the standard-console-appender. Whole message colored according to log level-->
<!--<Console name="SOUT" target="SYSTEM_OUT">-->
<!--<ThresholdFilter level="WARN" onMatch="DENY" onMismatch="ACCEPT"/>-->
<!--<PatternLayout pattern="%d{HH:mm:ss} [%t] %-7level %logger{3} - %msg%n"/>-->
<!--</Console>-->
<!--<Console name="SERR" target="SYSTEM_ERR">-->
<!--<ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/>-->
<!--<PatternLayout pattern="%d{HH:mm:ss} [%t] %-7level %logger{3} - %msg%n"/>-->
<!--</Console>-->
<Console name="ColoredConsoleAppender" target="SYSTEM_OUT" follow="true">
<PatternLayout
pattern="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} %highlight{${LOG_LEVEL_PATTERN:-%5p}}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=green, DEBUG=green bold, TRACE=blue} %style{%pid}{magenta} [%15.15t] %style{%-40.40C{1.}}{cyan} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%throwable}"/>
</Console>
<RollingFile name="fileAppender" fileName="${baseDir}/${logFileName}.log">
<FilePattern>${baseDir}/${logFileName}_%d{yyyy-MM-dd__HH-mm}_%i.log</FilePattern>
<PatternLayout>
<Pattern>%d{HH:mm:ss} [%t] %-5level %logger{6} - %msg%n</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="10" modulate="true"/>
<SizeBasedTriggeringPolicy size="250 MB"/>
</Policies>
<DefaultRolloverStrategy min="1" max="5" fileIndex="max">
<Delete basePath="${baseDir}" maxDepth="5">
<IfFileName glob="${logFileName}_*.log"/>
<testMode>false</testMode>
<IfAccumulatedFileCount exceeds="2"/>
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
<RollingFile name="htmlFileLogger" fileName="${baseDir}/app-info.html"
filePattern="${baseDir}/app-info-%d{yyyy-MM-dd}.html">
<HTMLLayout charset="UTF-8" title="Info Logs" locationInfo="true"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<SizeBasedTriggeringPolicy size="10 MB"/>
</Policies>
</RollingFile>
</Appenders>
<Loggers>
<!-- Every configuration must have a root logger. If one is not configured the default root LoggerConfig is ERROR with Console appender attached. -->
<Root level="DEBUG">
<!--<AppenderRef ref="SOUT"/>-->
<!--<AppenderRef ref="SERR"/>-->
<AppenderRef ref="fileAppender"/>
<AppenderRef ref="htmlFileLogger"/>
<AppenderRef ref="ColoredConsoleAppender"/>
</Root>
<!-- additivity means, that parent-logger (in every case the root-logger) will also get the chance to log this stuff -->
<Logger name="JDI" additivity="TRUE" level="DEBUG">
<AppenderRef ref="fileAppender"/>
<AppenderRef ref="htmlFileLogger"/>
</Logger>
</Loggers>
</Configuration>