-
Notifications
You must be signed in to change notification settings - Fork 3
/
log4j2-linux.xml
28 lines (24 loc) · 1.05 KB
/
log4j2-linux.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
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info"> <!-- changing this to DEBUG will add tons of DEBUG logs from log4j2 itself -->
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout
pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" />
</Console>
<!-- <File name="MyFile" fileName="~/logs/kg.log">--> <!-- will create a ~ directory from root -->
<!-- see https://stackoverflow.com/a/54008562/8534088 -->
<File name="MyFile" fileName="${sys:user.home}/logs/kg.log">
<PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</File>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="console" />
<AppenderRef ref="MyFile" />
</Root>
<Logger name="ru.klavogonki" level="debug" additivity="false">
<AppenderRef ref="console" />
<AppenderRef ref="MyFile" />
</Logger>
</Loggers>
</Configuration>