Skip to content

Commit

Permalink
Merge pull request #270 from MOONSHOT-Team/feature/#269
Browse files Browse the repository at this point in the history
[Feat] #269 - Sentry 로깅 기능 추가
  • Loading branch information
its-sky authored Apr 19, 2024
2 parents 70b488b + ebb194c commit 61f69c0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ subprojects {
}

dependencies {
// Spring Security

//Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'

Expand All @@ -43,6 +41,10 @@ subprojects {
// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mockito:mockito-core:5.9.0'

// Sentry
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:6.28.0'
implementation 'io.sentry:sentry-logback:6.28.0'
}

tasks.named('test') {
Expand Down
4 changes: 4 additions & 0 deletions moonshot-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ springdoc:

mybatis:
mapper-locations: mappers/*.xml

sentry:
dsn: ${SENTRY_DSN}
traces-sample-rate: 1.0
4 changes: 3 additions & 1 deletion moonshot-api/src/main/resources/logback-prod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
<springProfile name="prod">
<include resource="console-appender.xml"/>
<include resource="discord-appender.xml"/>
<include resource="sentry-appender.xml"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="ASYNC_DISCORD" />
<appender-ref ref="ASYNC_DISCORD"/>
<appender-ref ref="SENTRY"/>
</root>
</springProfile>
</configuration>
10 changes: 10 additions & 0 deletions moonshot-api/src/main/resources/sentry-appender.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<included>
<appender name="SENTRY" class="io.sentry.logback.SentryAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
</included>

0 comments on commit 61f69c0

Please sign in to comment.