-
Notifications
You must be signed in to change notification settings - Fork 1
/
log4j2.xml
38 lines (36 loc) · 1.44 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
The log file is written to `logs/app.log` and uses a rolling policy.
It will create up to 7 archives on the same day (1-7) that are stored in a directory based on the current year and month,
and will compress each archive using gzip.
Once a file reaches 100 MB or a new day is started, it is archived, and a new log file is created.
Only the last 90 archives are kept.
The logging level is set to 'info'.
See log4j2 guide for more options: http://logging.apache.org/log4j/2.x/manual/appenders.html#RollingRandomAccessFileAppender
-->
<Configuration status="warn" name="spring-boot-mongodb-app" packages="">
<Appenders>
<RollingFile name="SpringBootMongoDbApp_RollingFile" fileName="./logs/app.log"
filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
<PatternLayout>
<Pattern>%-4r [%t] %d %-5p %c{1} %M() - %m%n</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="100 MB"/>
</Policies>
<DefaultRolloverStrategy max="90"/>
</RollingFile>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout>
<Pattern>%-4r [%t] %d %-5p %c{1} %M() - %m%n</Pattern>
</PatternLayout>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="SpringBootMongoDbApp_RollingFile"/>
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>