-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_log4j2.xml
48 lines (47 loc) · 2.29 KB
/
config_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
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<Console name="LogToConsole" target="SYSTEM_OUT">
<!-- <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/> -->
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %p [%t] %C: %m%n"/>
</Console>
<!-- Rotate log files daily and when size limit of 100 MB is reached, https://mkyong.com/logging/apache-log4j-2-tutorials/ -->
<RollingFile name="LogKasseToRollingFile" fileName="${sys:user.home}/.Weltladenkasse_logs/Kasse.log"
filePattern="${sys:user.home}/.Weltladenkasse_logs/Kasse-%d{uu-EE}-%i.log">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %p [%t] %C: %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<SizeBasedTriggeringPolicy size="100MB"/>
</Policies>
<DefaultRolloverStrategy max="7"/>
</RollingFile>
<RollingFile name="LogBestellerToRollingFile" fileName="${sys:user.home}/.Weltladenkasse_logs/Besteller.log"
filePattern="${sys:user.home}/.Weltladenkasse_logs/Besteller-%d{uu-EE}-%i.log">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %p [%t] %C: %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<SizeBasedTriggeringPolicy size="100MB"/>
</Policies>
<DefaultRolloverStrategy max="7"/>
</RollingFile>
</Appenders>
<Loggers>
<!-- avoid duplicated logs with additivity=false -->
<!-- Log for code shared by both Kasse and Besteller -->
<Logger name="org.weltladen_bonn.pos" level="debug" additivity="true">
<AppenderRef ref="LogKasseToRollingFile"/>
<AppenderRef ref="LogBestellerToRollingFile"/>
</Logger>
<!-- Log for Kasse -->
<Logger name="org.weltladen_bonn.pos.kasse" level="debug" additivity="true">
<AppenderRef ref="LogKasseToRollingFile"/>
</Logger>
<!-- Log for Besteller -->
<Logger name="org.weltladen_bonn.pos.besteller" level="debug" additivity="true">
<AppenderRef ref="LogBestellerToRollingFile"/>
</Logger>
<Root level="error">
<AppenderRef ref="LogToConsole"/>
</Root>
</Loggers>
</Configuration>