Skip to content

Commit

Permalink
release(에러 로깅 구축): 1.2.0 (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
softpeanut authored Jan 3, 2023
2 parents 6c24391 + b73537b commit 067cf46
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- "*"
pull_request:
branches:
- develop

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- "*"
pull_request:
branches:
- develop

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ object Dependencies {

// firebase
const val FIREBASE_ADMIN = "com.google.firebase:firebase-admin:${DependencyVersions.FIREBASE_ADMIN_VERSION}"

// sentry
const val SENTRY = "io.sentry:sentry-spring-boot-starter:${DependencyVersions.SENTRY_VERSION}"
}
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/DependencyVersions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ object DependencyVersions {
const val COMMONS_IO = "2.11.0"
const val POI_VERSION = "5.2.3"
const val FIREBASE_ADMIN_VERSION = "9.1.0"
const val SENTRY_VERSION = "6.10.0"
}
3 changes: 3 additions & 0 deletions simtong-infrastructure/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ dependencies {
// firebase
implementation(Dependencies.FIREBASE_ADMIN)

// sentry
implementation(Dependencies.SENTRY)

// configuration
annotationProcessor(Dependencies.CONFIGURATION_PROCESSOR)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package team.comit.simtong.global.filter

import com.fasterxml.jackson.databind.ObjectMapper
import io.sentry.Sentry
import org.springframework.http.MediaType
import org.springframework.web.filter.OncePerRequestFilter
import team.comit.simtong.global.error.dto.ErrorResponse
Expand Down Expand Up @@ -32,8 +33,10 @@ class ExceptionFilter(
try {
filterChain.doFilter(request, response)
} catch (e: BusinessException) {
Sentry.captureException(e)
writeErrorCode(e, response)
} catch (e: Exception) {
Sentry.captureException(e)
when (e.cause) {
is BusinessException -> writeErrorCode(e.cause as BusinessException, response)
is WebException -> writeErrorCode(e.cause as WebException, response)
Expand Down
4 changes: 4 additions & 0 deletions simtong-infrastructure/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ spring:
jackson:
property-naming-strategy: SNAKE_CASE

sentry:
dsn: ${SENTRY_DSN}
traces-sample-rate: 1.0

logging:
level:
com:
Expand Down

0 comments on commit 067cf46

Please sign in to comment.