-
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.
* feat: 슬랙 알림 채널 연동 * feat: properties.xml 추가 * chore: webhook uri 재생성 및 노출 제외 * feat: prod logback 분리
- Loading branch information
Showing
9 changed files
with
68 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
16 changes: 13 additions & 3 deletions
16
src/main/java/com/nexters/goalpanzi/GoalpanziApplication.java
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 |
---|---|---|
@@ -1,13 +1,23 @@ | ||
package com.nexters.goalpanzi; | ||
|
||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
import java.util.TimeZone; | ||
|
||
@SpringBootApplication | ||
public class GoalpanziApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(GoalpanziApplication.class, args); | ||
} | ||
public static void main(String[] args) { | ||
var ctx = SpringApplication.run(GoalpanziApplication.class, args); | ||
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul")); | ||
var serverPort = ctx.getEnvironment().getProperty("server.port"); | ||
var profile = ctx.getEnvironment().getProperty("spring.profiles.active"); | ||
|
||
// startup notification | ||
String banner = String.format("GoalpanziApplication started (profile=%s, port=%s)", profile, serverPort); | ||
System.out.println(banner); | ||
LoggerFactory.getLogger("ServerBoot").info(banner); | ||
} | ||
} |
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,34 @@ | ||
<included> | ||
<appender name="SLACK" class="com.github.maricn.logback.SlackAppender"> | ||
<layout class="ch.qos.logback.classic.PatternLayout"> | ||
<pattern> | ||
[%thread] %-5level traceId:"%X{traceId:-}" spanId:"%X{spanId:-}"%n%msg%n | ||
</pattern> | ||
</layout> | ||
<webhookUri>${SLACK_WEBHOOK_URI}</webhookUri> | ||
<username>${SLACK_USERNAME}</username> | ||
<channel>${SLACK_CHANNEL}</channel> | ||
<iconEmoji>:bell:</iconEmoji> | ||
<colorCoding>true</colorCoding> | ||
</appender> <!-- Currently recommended way of using Slack 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="BOOT-SLACK" class="com.github.maricn.logback.SlackAppender"> | ||
<layout class="ch.qos.logback.classic.PatternLayout"> | ||
<pattern> | ||
*Server Name:* `${HOSTNAME:-}` %n%msg%n | ||
</pattern> | ||
</layout> | ||
<webhookUri>${SLACK_WEBHOOK_URI}</webhookUri> | ||
<username>${SLACK_USERNAME}</username> | ||
<channel>${SLACK_CHANNEL}</channel> | ||
<iconEmoji>:bell:</iconEmoji> | ||
<colorCoding>true</colorCoding> | ||
</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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
server: | ||
port: 8080 | ||
|
||
spring: | ||
h2: | ||
console: | ||
|
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,4 @@ | ||
<included> | ||
<property name="SLACK_USERNAME" value="monitor-mission-mate"/> | ||
<property name="SLACK_CHANNEL" value="mission-mate-live"/> | ||
</included> |