Skip to content
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
12 changes: 5 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ java {

repositories {
mavenCentral()
maven(url = "https://jitpack.io")
}

dependencies {
Expand All @@ -35,17 +36,14 @@ dependencies {
runtimeOnly("com.h2database:h2")
runtimeOnly("com.mysql:mysql-connector-j")

//jwt
// etc
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("tools.jackson.module:jackson-module-kotlin")
implementation("io.jsonwebtoken:jjwt-api:0.13.0")
implementation("io.jsonwebtoken:jjwt-impl:0.13.0")
implementation("io.jsonwebtoken:jjwt-jackson:0.13.0")

// fcm
implementation("com.google.firebase:firebase-admin:9.4.3")

// etc
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("tools.jackson.module:jackson-module-kotlin")
implementation("com.github.napstr:logback-discord-appender:1.0.0")

// test
testImplementation("io.mockk:mockk:1.13.12")
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ oidc:
apple:
jwks-uri: ${secret.oauth.apple.jwks-uri}
cache-ttl-seconds: ${secret.oauth.cache-ttl-seconds}

logging:
discord:
webhook-uri: ${secret.discord.webhook-uri}
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ spring:
- moa-secret/jwt.yml
- moa-secret/db.yml
- moa-secret/admin.yml
- moa-secret/discord.yml

profiles:
default: local
2 changes: 2 additions & 0 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
</springProfile>

<springProfile name="prod">
<include resource="logback/discord-appender.xml"/>
<root level="WARN">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="ASYNC_DISCORD"/>
</root>
<logger name="com.moa" level="INFO"/>
</springProfile>
Expand Down
20 changes: 20 additions & 0 deletions src/main/resources/logback/discord-appender.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<included>
<springProperty name="discordWebhookUri" source="logging.discord.webhook-uri"/>

<appender name="DISCORD" class="com.github.napstr.logback.DiscordAppender">
<webhookUri>${discordWebhookUri}</webhookUri>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>🚨 [%-5level] %msg%n🕒 %d{yyyy-MM-dd HH:mm:ss.SSS}%n🆔 request=%X{requestId:-?} | member=%X{memberId:-?}%n📍 %logger{36}%n%replace(%replace(%ex{full}){'(?s)^$','no stacktrace'}){'(?s)[\s\S]+','```$0```'}</pattern>
</layout>
<username>Spring</username>
<avatarUrl>https://yt3.googleusercontent.com/ytc/AIdro_mktZcTw2hqHO9L_FJitBqaDyGbjOcBb6Qt3t-ZPfKuPQ=s900-c-k-c0x00ffffff-no-rj</avatarUrl>
<tts>false</tts>
</appender>

<appender name="ASYNC_DISCORD" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="DISCORD"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
Comment thread
jeyongsong marked this conversation as resolved.
</included>
2 changes: 1 addition & 1 deletion src/main/resources/moa-secret
Loading