-
Notifications
You must be signed in to change notification settings - Fork 2
/
logback-spring.xml
79 lines (66 loc) ยท 3.71 KB
/
logback-spring.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProperty scope="context" name="LOG_LEVEL" source="logging.level.com.dadok.gaerval"/>
<!-- profile์ด local์ธ ๊ฒฝ์ฐ-->
<springProfile name="local">
<property name="PATH" value="./logs/local.log"/>
</springProfile>
<!-- profile์ด develop์ธ ๊ฒฝ์ฐ-->
<springProfile name="develop">
<property name="PATH" value="./logs/develop.log"/>
</springProfile>
<!-- ์คํ๋ง๋ถํธ ๊ธฐ๋ณธ ๋ก๊น
ํจํด -->
<conversionRule conversionWord="clr"
converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- ํ์ผ๋ก๊ทธ ํจํด -->
<property name="LOG_PATTERN" value="%-5level %d{yy-MM-dd HH:mm:ss}[%thread] [%logger{0}:%line] - %msg%n"/>
<!-- ์ฝ์ ๋ก๊ทธ๋ ์คํ๋ง๋ถํธ ๊ธฐ๋ณธ ํจํด ์ ์ฉ -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- ํ์ผ ๊ฒฝ๋ก ๋ฐ ์ด๋ฆ -->
<file>${PATH}</file>
<append>true</append>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!-- ๋ก๊ทธํ์ผ์ ๊ต์ฒดํ๋ ์ ์ฑ
TimeBasedRollingPolicy: ์๊ฐ ๋จ์ -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>./logs/dadok-file.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>30MB</maxFileSize>
<maxHistory>7</maxHistory>
<!--์ ์ฒด ์ฉ๋ ์ ์ด(maxHistory์ ํจ๊ป ์ฌ์ฉ ํ์)-->
<totalSizeCap>1GB</totalSizeCap>
</rollingPolicy>
</appender>
<logger level="debug" name="com.dadok.gaerval"/>
<logger level="debug" name="org.springframework.web"/>
<logger level="info" name="org.hibernate.loader.Loader"/>
<logger level="info" name="org.hibernate.engine.internal.TwoPhaseLoad"/>
<logger level="info" name="org.hibernate.SQL"/>
<logger level="off" name="org.hibernate.hql.internal.classic.QueryTranslatorImpl"/>
<logger level="off" name="org.hibernate.hql.internal.ast.util.JoinProcessor"/>
<logger level="off" name="org.hibernate.hql.internal"/>
<logger level="debug" name="org.springframework.data.redis"/>
<logger level="off" name="ConditionEvaluationReportLoggingListener"/>
<logger level="off" name="org.springframework.beans.factory.support.DefaultListableBeanFactory"/>
<logger level="off" name="org.springframework.web.servlet.HandlerMapping.Mappings"/>
<logger level="off" name="org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource"/>
<root level="debug">
<springProfile name="local,develop">
<appender-ref ref="STDOUT"/>
</springProfile>
<springProfile name="develop">
<appender-ref ref="FILE"/>
</springProfile>
</root>
</configuration>