Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ddongseop committed Jan 16, 2024
2 parents 3aa1c26 + 6853da0 commit fdc6af4
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 22 deletions.
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 @@ -33,7 +33,4 @@ springdoc:
enabled: true
cache:
disabled: true
show-login-endpoint: true

logging:
config: classpath:logback-spring.xml
show-login-endpoint: true
12 changes: 6 additions & 6 deletions src/main/resources/discord-business-appender.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<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>
<username>섭섭이_봇 🐣</username>
<avatarUrl>https://github.com/Team-Lecue/Lecue-Server/assets/67463603/67cf5665-ab6c-4eb0-8fa2-85a6dd8188b6
</avatarUrl>
<layout class="ch.qos.logback.classic.PatternLayout">
Expand All @@ -19,9 +19,9 @@
</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>
<username>히파람_봇 📝</username>
<avatarUrl>https://github.com/Team-Lecue/Lecue-Server/assets/67463603/76b91fd6-3589-4c74-9b70-2b6e251ac384
</avatarUrl>
<layout class="ch.qos.logback.classic.PatternLayout">
Expand All @@ -37,9 +37,9 @@
</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>
<username>찌니_봇 💌</username>
<avatarUrl>https://github.com/Team-Lecue/Lecue-Server/assets/67463603/25641e5f-9e28-4852-9458-380313c953cc
</avatarUrl>
<layout class="ch.qos.logback.classic.PatternLayout">
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>

0 comments on commit fdc6af4

Please sign in to comment.