-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from it-s-time-goat/dev/ldy/logging
[FEAT] 로그백을 이용한 로깅 기능 적용
- Loading branch information
Showing
10 changed files
with
270 additions
and
31 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
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
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>${CONSOLE_LOG_PATTERN}</pattern> | ||
</encoder> | ||
</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,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<configuration> | ||
<property name="FILE_LOG_PATTERN" | ||
value="[%d{yyyy-MM-dd HH:mm:ss}:%-4relative] [%thread] %-5level [%C.%M:%L] - %msg %ex{5}%n"/> | ||
<property name="CONSOLE_LOG_PATTERN" | ||
value="[%d{yyyy-MM-dd HH:mm:ss}:%-4relative] %green([%thread]) %highlight(%-5level) %boldWhite([%C.%M:%yellow(%L)]) - %msg %ex{5}%n"/> | ||
|
||
<springProfile name="local"> | ||
<include resource="console-appender.xml"/> | ||
<root level="INFO"> | ||
<appender-ref ref="CONSOLE"/> | ||
</root> | ||
</springProfile> | ||
|
||
<springProfile name="dev"> | ||
<include resource="logs/common/file-info-appender.xml"/> | ||
<include resource="logs/common/file-warn-appender.xml"/> | ||
<include resource="logs/common/file-error-appender.xml"/> | ||
<include resource="logs/error/file-info-appender.xml"/> | ||
<include resource="logs/error/file-warn-appender.xml"/> | ||
<include resource="logs/error/file-error-appender.xml"/> | ||
|
||
<logger additivity="false" level="INFO" name="ErrorLogger"> | ||
<appender-ref ref="ERROR_ERROR"/> | ||
<appender-ref ref="ERROR_WARN"/> | ||
<appender-ref ref="ERROR_INFO"/> | ||
</logger> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="FILE-INFO"/> | ||
<appender-ref ref="FILE-WARN"/> | ||
<appender-ref ref="FILE-ERROR"/> | ||
</root> | ||
</springProfile> | ||
|
||
<springProfile name="prod"> | ||
<include resource="logs/common/file-info-appender.xml"/> | ||
<include resource="logs/common/file-warn-appender.xml"/> | ||
<include resource="logs/common/file-error-appender.xml"/> | ||
<include resource="logs/error/file-info-appender.xml"/> | ||
<include resource="logs/error/file-warn-appender.xml"/> | ||
<include resource="logs/error/file-error-appender.xml"/> | ||
|
||
<logger additivity="false" level="INFO" name="ErrorLogger"> | ||
<appender-ref ref="ERROR_ERROR"/> | ||
<appender-ref ref="ERROR_WARN"/> | ||
<appender-ref ref="ERROR_INFO"/> | ||
</logger> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="FILE-INFO"/> | ||
<appender-ref ref="FILE-WARN"/> | ||
<appender-ref ref="FILE-ERROR"/> | ||
</root> | ||
</springProfile> | ||
|
||
</configuration> |
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,19 @@ | ||
<included> | ||
<appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="FILE-ERROR"> | ||
<encoder> | ||
<pattern>${FILE_LOG_PATTERN}</pattern> | ||
</encoder> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>ERROR</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<fileNamePattern>${LOG_PATH}/log/common/error/error-%d{yyyy-MM-dd}.%i.log | ||
</fileNamePattern> | ||
<maxFileSize>100MB</maxFileSize> | ||
<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,19 @@ | ||
<included> | ||
<appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="FILE-INFO"> | ||
<encoder> | ||
<pattern>${FILE_LOG_PATTERN}</pattern> | ||
</encoder> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>INFO</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<fileNamePattern>${LOG_PATH}/log/common/info/info-%d{yyyy-MM-dd}.%i.log | ||
</fileNamePattern> | ||
<maxFileSize>100MB</maxFileSize> | ||
<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,19 @@ | ||
<included> | ||
<appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="FILE-WARN"> | ||
<encoder> | ||
<pattern>${FILE_LOG_PATTERN}</pattern> | ||
</encoder> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>WARN</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<fileNamePattern>${LOG_PATH}/log/common/warn/warn-%d{yyyy-MM-dd}.%i.log | ||
</fileNamePattern> | ||
<maxFileSize>100MB</maxFileSize> | ||
<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,19 @@ | ||
<included> | ||
<appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="ERROR_ERROR"> | ||
<encoder> | ||
<pattern>${FILE_LOG_PATTERN}</pattern> | ||
</encoder> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>ERROR</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<fileNamePattern>${LOG_PATH}/log/error/error/error-%d{yyyy-MM-dd}.%i.log | ||
</fileNamePattern> | ||
<maxFileSize>100MB</maxFileSize> | ||
<maxHistory>100</maxHistory> | ||
<totalSizeCap>4GB</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,19 @@ | ||
<included> | ||
<appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="ERROR_INFO"> | ||
<encoder> | ||
<pattern>${FILE_LOG_PATTERN}</pattern> | ||
</encoder> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>INFO</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
<fileNamePattern>${LOG_PATH}/log/error/info/info-%d{yyyy-MM-dd}.%i.log | ||
</fileNamePattern> | ||
<maxFileSize>100MB</maxFileSize> | ||
<maxHistory>100</maxHistory> | ||
<totalSizeCap>4GB</totalSizeCap> | ||
</rollingPolicy> | ||
</appender> | ||
</included> |
Oops, something went wrong.