-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: logback slack appender 라이브러리 의존성 추가 * feat: 로그 파일 작성
- Loading branch information
Showing
3 changed files
with
46 additions
and
3 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,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<springProperty name="SLACK_WEBHOOK_URL" source="webhook.slack.url"/> | ||
|
||
<appender name="SLACK" class="com.github.maricn.logback.SlackAppender"> | ||
<webhookUri>${SLACK_WEBHOOK_URL}</webhookUri> | ||
<layout class="ch.qos.logback.classic.PatternLayout"> | ||
<pattern> | ||
에러 로그를 수집했습니다 🚓 | ||
✅ Timestamp\n%d{yyyy-MM-dd HH:mm:ss}\n 📍 Error Message\n%msg | ||
</pattern> | ||
<colorCoding>true</colorCoding> | ||
</layout> | ||
</appender> | ||
|
||
<appender name="ASYNC_SLACK" class="ch.qos.logback.classic.AsyncAppender"> | ||
<appender-ref ref="SLACK"/> | ||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
<level>ERROR</level> | ||
</filter> | ||
</appender> | ||
|
||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<layout class="ch.qos.logback.classic.PatternLayout"> | ||
<Pattern>[%d{yyyy-MM-dd HH:mm:ss}:%-3relative][%thread] %-5level %logger{36} - %msg%n</Pattern> | ||
</layout> | ||
</appender> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="STDOUT"/> | ||
<springProfile name="dev,prod"> | ||
<appender-ref ref="ASYNC_SLACK"/> | ||
</springProfile> | ||
</root> | ||
</configuration> |