-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<included> | ||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>${LOG_PATTERN}</pattern> | ||
</encoder> | ||
</appender> | ||
</included> |
21 changes: 21 additions & 0 deletions
21
hous-notification/src/main/resources/file-error-appender.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<included> | ||
<appender name="FILE-ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>/home/ubuntu/hous-notification/logs/error/error.log</file> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>ERROR</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<encoder> | ||
<pattern>${LOG_PATTERN}</pattern> | ||
</encoder> | ||
<!-- 일자별 로그파일 생성 --> | ||
<!-- Application이 동작중일 땐 활성화된 로그 파일에 로그를 쌓이고, 매일 자정이 지나면 info-2020-10-03.log 와 같은 이름으로 생성 --> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>/home/ubuntu/hous-notification/logs/error/error-%d{yyyy-MM-dd}.log</fileNamePattern> | ||
<!-- 30일동안, 최대 3GB의 log를 저장함 --> | ||
<maxHistory>30</maxHistory> | ||
<totalSizeCap>3GB</totalSizeCap> | ||
</rollingPolicy> | ||
</appender> | ||
</included> |
21 changes: 21 additions & 0 deletions
21
hous-notification/src/main/resources/file-info-appender.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<included> | ||
<appender name="FILE-INFO" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>/home/ubuntu/hous-notification/logs/info/info.log</file> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>INFO</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<encoder> | ||
<pattern>${LOG_PATTERN}</pattern> | ||
</encoder> | ||
<!-- 일자별 로그파일 생성 --> | ||
<!-- Application이 동작중일 땐 활성화된 로그 파일에 로그를 쌓이고, 매일 자정이 지나면 info-2020-10-03.log 와 같은 이름으로 생성 --> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>/home/ubuntu/hous-notification/logs/info/info-%d{yyyy-MM-dd}.log</fileNamePattern> | ||
<!-- 30일동안, 최대 3GB의 log를 저장함 --> | ||
<maxHistory>30</maxHistory> | ||
<totalSizeCap>3GB</totalSizeCap> | ||
</rollingPolicy> | ||
</appender> | ||
</included> |
21 changes: 21 additions & 0 deletions
21
hous-notification/src/main/resources/file-warn-appender.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<included> | ||
<appender name="FILE-WARN" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>/home/ubuntu/hous-notification/logs/warn/warn.log</file> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>WARN</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<encoder> | ||
<pattern>${LOG_PATTERN}</pattern> | ||
</encoder> | ||
<!-- 일자별 로그파일 생성 --> | ||
<!-- Application이 동작중일 땐 활성화된 로그 파일에 로그를 쌓이고, 매일 자정이 지나면 info-2020-10-03.log 와 같은 이름으로 생성 --> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>/home/ubuntu/hous-notification/logs/warn/warn-%d{yyyy-MM-dd}.log</fileNamePattern> | ||
<!-- 30일동안, 최대 3GB의 log를 저장함 --> | ||
<maxHistory>30</maxHistory> | ||
<totalSizeCap>3GB</totalSizeCap> | ||
</rollingPolicy> | ||
</appender> | ||
</included> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<property name="LOG_PATTERN" | ||
value="[%d{yyyy-MM-dd HH:mm:ss}:%-4relative] %green([%thread]) %highlight(%-5level) %boldWhite([%C.%M:%yellow(%L)]) - %msg%n"/> | ||
|
||
<!-- prod 환경이 아닌 경우, ConsoleAppender 사용하여 콘솔창에 보임 --> | ||
<springProfile name="local"> | ||
<include resource="console-appender.xml"/> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="CONSOLE"/> | ||
</root> | ||
</springProfile> | ||
|
||
<!-- [Log Level] TRACE < DEBUG < INFO < WARN < ERROR 대소문자 구분 안함 --> | ||
<springProfile name="!local"> | ||
<include resource="file-info-appender.xml"/> | ||
<include resource="file-warn-appender.xml"/> | ||
<include resource="file-error-appender.xml"/> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="FILE-INFO"/> | ||
<appender-ref ref="FILE-WARN"/> | ||
<appender-ref ref="FILE-ERROR"/> | ||
</root> | ||
</springProfile> | ||
</configuration> |