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

[FIX] 디스코드 알림 수정사항 반영 #61

Merged
merged 6 commits into from
Jan 15, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
/secret/lequu
parse-json: false

- name: application-secret.properties 생성 (환경변수가 AWS Secrets Manager보다 빠르게 로드되어야 할때)
run: |
cd src/main/resources
echo "${{ secrets.PROPERTIES }}" > ./application-secret.properties

- name: Build
run: |
chmod +x gradlew
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
/secret/lequu
parse-json: false

- name: application-secret.properties 생성 (환경변수가 AWS Secrets Manager보다 빠르게 로드되어야 할때)
run: |
cd src/main/resources
echo "${{ secrets.PROPERTIES }}" > ./application-secret.properties

- name: Build
run: |
chmod +x gradlew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import org.sopt.lequuServer.domain.member.model.Member;
import org.sopt.lequuServer.domain.note.model.Note;

import java.text.SimpleDateFormat;
import java.util.Date;

public class LoggingMessage {

public static String memberRegisterLogMessage(Member member) {
Expand Down Expand Up @@ -41,12 +44,18 @@ public static String noteCreateLogMessage(Member member, Book book, Note note) {
}

public static String serverErrorMessage() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formattedDate = sdf.format(new Date());
return "🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨\n\n" +
"- ⚠️ ERROR TIME: " + formattedDate + "\n" +
"- 🚨 야생의 서버 에러가 발생했다!: ";
}

public static String jwtErrorMessage() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formattedDate = sdf.format(new Date());
return "🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨\n\n" +
"- ⚠️ ERROR TIME: " + formattedDate + "\n" +
"- 🚨 JWT 에러 필터에서 오류 발생!: ";
}
}
11 changes: 10 additions & 1 deletion src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
config:
activate:
on-profile: dev
import: optional:application-secret.properties

datasource:
driver-class-name: ${DB_NAME_DEV}
Expand Down Expand Up @@ -36,4 +37,12 @@ server:
sentry:
dsn: ${SENTRY_DSN}
traces-sample-rate: 1.0
exception-resolver-order: -2147483647
exception-resolver-order: -2147483647

logging:
discord:
error-uri: ${DISCORD_ERROR_URI}
business-1-uri: ${DISCORD_BUSINESS_1_URI}
business-2-uri: ${DISCORD_BUSINESS_2_URI}
business-3-uri: ${DISCORD_BUSINESS_3_URI}
config: classpath:logback-dev.xml
5 changes: 4 additions & 1 deletion src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ kakao:
sentry:
dsn:
traces-sample-rate: 1.0
exception-resolver-order: -2147483647
exception-resolver-order: -2147483647

logging:
config: classpath:logback-local.xml
5 changes: 1 addition & 4 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,4 @@ springdoc:
enabled: true
cache:
disabled: true
show-login-endpoint: true

logging:
config: classpath:logback-spring.xml
show-login-endpoint: true
6 changes: 3 additions & 3 deletions src/main/resources/discord-business-appender.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<included>
<appender name="DISCORD_1" class="com.github.napstr.logback.DiscordAppender">
<webhookUri>
https://discord.com/api/webhooks/1195948437414359130/XUALknmWMWxKINukDY-7vakMQ6azarz7eGZV_NXb2c9v3a3ohjr8InY5Obi5wMocanDy
${DISCORD_BUSINESS_1_URI}
</webhookUri>
<username>Register is detected 🐣</username>
<avatarUrl>https://github.com/Team-Lecue/Lecue-Server/assets/67463603/67cf5665-ab6c-4eb0-8fa2-85a6dd8188b6
Expand All @@ -19,7 +19,7 @@
</appender>
<appender name="DISCORD_2" class="com.github.napstr.logback.DiscordAppender">
<webhookUri>
https://discord.com/api/webhooks/1195949062709575810/dF7Oxhpf7tc1p_ypzGQv2FU4g8Fe2u_hC49_yqXsbRjJisOwK5m-c92T7VEQn8Ish-GV
${DISCORD_BUSINESS_2_URI}
</webhookUri>
<username>Lecue Book is created 📝</username>
<avatarUrl>https://github.com/Team-Lecue/Lecue-Server/assets/67463603/76b91fd6-3589-4c74-9b70-2b6e251ac384
Expand All @@ -37,7 +37,7 @@
</appender>
<appender name="DISCORD_3" class="com.github.napstr.logback.DiscordAppender">
<webhookUri>
https://discord.com/api/webhooks/1195948338546221107/7eaJ2jjDrMeOg-OO9lZfX2SjCTmHbDQom7wD04ffpMXyJBFx6sJDGetmDlQlXcAQDEHO
${DISCORD_BUSINESS_3_URI}
</webhookUri>
<username>Lecue Note is attached 💌</username>
<avatarUrl>https://github.com/Team-Lecue/Lecue-Server/assets/67463603/25641e5f-9e28-4852-9458-380313c953cc
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/discord-error-appender.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<included>
<appender name="DISCORD" class="com.github.napstr.logback.DiscordAppender">
<webhookUri>
https://discord.com/api/webhooks/1195711881223090307/PlB-JBGazAPBK5-KzMWs4Ei6DEy9Evd4IsFIxylgHXZuV-iNvsrs2ejzA2b3QJLVlrpy
${DISCORD_ERROR_URI}
</webhookUri>
<username>Internel Server Error detected 🚨</username>
<avatarUrl>https://s3.orbi.kr/data/file/united/251cc0d1434cc0aed00afe93082bb25a.jpeg</avatarUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
<timestamp key="BY_DATE" datePattern="yyyy-MM-dd"/>
<property name="LOG_PATTERN"
value="[%d{yyyy-MM-dd HH:mm:ss}:%-4relative] %green([%thread]) %highlight(%-5level) %boldWhite([%C.%M:%yellow(%L)]) %msg%n"/>
<springProfile name="local">
<include resource="console-appender.xml"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
<logger name="org.springframework.context.support.PostProcessorRegistrationDelegate" level="WARN"/>
<logger name="org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport"
level="WARN"/>
</springProfile>
<springProperty name="DISCORD_ERROR_URI" source="logging.discord.error-uri"/>
<springProperty name="DISCORD_BUSINESS_1_URI" source="logging.discord.business-1-uri"/>
<springProperty name="DISCORD_BUSINESS_2_URI" source="logging.discord.business-2-uri"/>
<springProperty name="DISCORD_BUSINESS_3_URI" source="logging.discord.business-3-uri"/>

<springProfile name="!local">
<include resource="console-appender.xml"/>
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/logback-local.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<configuration>
<timestamp key="BY_DATE" datePattern="yyyy-MM-dd"/>
<property name="LOG_PATTERN"
value="[%d{yyyy-MM-dd HH:mm:ss}:%-4relative] %green([%thread]) %highlight(%-5level) %boldWhite([%C.%M:%yellow(%L)]) %msg%n"/>
<springProfile name="local">
<include resource="console-appender.xml"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
<logger name="org.springframework.context.support.PostProcessorRegistrationDelegate" level="WARN"/>
<logger name="org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport"
level="WARN"/>
</springProfile>
</configuration>
Loading