-
Notifications
You must be signed in to change notification settings - Fork 2
/
log4j2.xml
34 lines (30 loc) · 1.12 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
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<!-- For Console-->
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%sn %d{yyyy/MM/dd HH:mm:ss,SSS} %r [%-6p] [%t] %c{3} [%C{3}.%M(%F:%L)] - %m%n"/>
</Console>
<!-- For writing logs to a file-->
<File name="LogFile" fileName="app.log">
<PatternLayout>
<PatternLayout pattern="%sn %d{yyyy/MM/dd HH:mm:ss,SSS} %r [%-6p] [%t] %c{3} [%C{3}.%M(%F:%L)] - %m%n"/>
</PatternLayout>
</File>
<!-- For writing logs to a JSON file-->
<File name="LogFile" fileName="app.json">
<JsonLayout complete="true" properties="true" locationInfo="true"/>
</File>
<!-- For File writing on Different Thread-->
<Async name="Async">
<AppenderRef ref="LogFile"/>
</Async>
</Appenders>
<!-- Types of Loggers -->
<Loggers>
<Root level="trace">
<AppenderRef ref="Console"/>
<AppenderRef ref="LogFile"/>
</Root>
</Loggers>
</Configuration>