Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] Refactor/#376-2 운영 서버 500 에러 슬랙 알림 적용, 로컬 환경변수 서브모듈에 저장 #379

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions backend/src/main/resources/application.yml

This file was deleted.

2 changes: 1 addition & 1 deletion backend/src/main/resources/config
5 changes: 2 additions & 3 deletions backend/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@
</logger>
</springProfile>

<!-- 슬랙 알림 appender는 웹훅 URI을 가져와야 하므로 서브모듈 적용 이후 수정하며 활성화시키겠습니다. -->
<springProfile name="prod">
<include resource="file-info-appender.xml"/>
<include resource="file-warn-appender.xml"/>
<include resource="file-error-appender.xml"/>
<!-- <include resource="slack-error-appender.xml"/>-->
<include resource="slack-error-appender.xml"/>

<root level="INFO">
<appender-ref ref="FILE_INFO"/>
<appender-ref ref="FILE_WARN"/>
<appender-ref ref="FILE_ERROR"/>
<!-- <appender-ref ref="SLACK_ERROR"/>-->
<appender-ref ref="SLACK_ERROR"/>
</root>
</springProfile>
</configuration>
17 changes: 17 additions & 0 deletions backend/src/main/resources/slack-error-appender.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<included>
<springProperty name="SLACK_INCOMING_WEBHOOK_URI" source="logging.slack.webhook" />
<appender name="SLACK_ERROR" class="com.github.maricn.logback.SlackAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<webhookUri>${SLACK_INCOMING_WEBHOOK_URI}</webhookUri>
<username>ERROR-ALARM</username>
<iconEmoji>:rotating_light:</iconEmoji>
<colorCoding>true</colorCoding>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
</included>