• pom.xml에 디펜더시 추가(maven 기준)
    • 버전은 maven repo나 git에서 확인
		<!-- https://mvnrepository.com/artifact/io.sentry/sentry-logback -->
        <dependency>
            <groupId>io.sentry</groupId>
            <artifactId>sentry-logback</artifactId>
            <version>3.2.0</version>
        </dependency>

 

  • logback.properties에 설정 추가
    • logback-spring.xml에서 참조하는 properties파일
#sentry에 전송시 environment 구분 값(ex. local, alpha, beta, qa, real)
sentry.environment=입력필요

#sentry 에서 dsn정보 확인 후 입력
sentry.dsn=입력필요
  • logback-spring.xml 에 설정 추가
    • 아래 appender추가 후 전송할 logger에 꼭 appender-ref ref를 추가해야함
<!-- Configure the Sentry appender -->
    <appender name="SENTRY" class="io.sentry.logback.SentryAppender">
        <!-- Optionally change minimum Event level. Default for Events is ERROR -->
        <minimumEventLevel>ERROR</minimumEventLevel>
        <!-- Optionally change minimum Breadcrumbs level. Default for Breadcrumbs is INFO -->
        <minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel>
        <options>
            <!-- NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry project/dashboard -->
            <dsn>${sentry.dsn}</dsn>
            <environment>${sentry.environment}</environment>
        </options>
    </appender>

 

 

+ Recent posts