generated from arafkarsh/ms-springboot-324-java-22-jakarta-ee-10
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathlogback-spring-appenders-text.xml
executable file
·34 lines (32 loc) · 1.68 KB
/
logback-spring-appenders-text.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
<included>
<!-- Define the Standard Output - Console TEXT -->
<appender name="STDOUT_TEXT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%white(%d{yyyy-MM-dd HH:mm:ss.SSS}) |Service=%cyan(%X{Service})|%highlight(%-5level)| %cyan(%logger{10}:%L) |IP=%white(%X{IP}:%X{Port})| Proto=%white(%X{Protocol})| URI=%white(%X{URI})| User=%green(%X{user})| ReqID=%magenta(%X{ReqId})| %yellow(%msg%n)</pattern>
</encoder>
</appender>
<!-- Define the File Appender -->
<appender name="FILE_TEXT" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/${LOG_FILE}.log</file>
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- Combines size-based rolling and time-based rolling -->
<fileNamePattern>${LOG_FILE_PATTERN}.log</fileNamePattern>
<!-- Specify max size of a single log file -->
<maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize>
<!-- Retain log history for a specific number of days -->
<maxHistory>${LOG_FILE_MAX_HISTORY}</maxHistory>
<!-- Specify file size Cap -->
<totalSizeCap>${LOG_FILE_SIZE_CAP}</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} |Service=%X{Service} |%-5level| %logger{36}:%L |IP=%X{IP}:%X{Port}| Proto=%X{Protocol}| URI=%X{URI}| User=%X{user}| ReqID=%X{ReqId}| %msg%n</pattern>
</encoder>
</appender>
<!-- Asynchronous Logging PLAIN Text -->
<appender name="ASYNC_TEXT" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE_TEXT" />
<queueSize>5000</queueSize>
<discardingThreshold>0</discardingThreshold>
</appender>
</included>