目录

sentry在java中用法

目录

sentry配置

使用sentry 进行异常报警

  1. sentry安装 sentry 目前推荐使用docker安装,docker-compose启动 官方安装链接:https://docs.sentry.io/server/installation

  2. 添加maven依赖

1
2
3
4
5
<dependency>
    <groupId>com.getsentry.raven</groupId>
    <artifactId>raven-logback</artifactId>
    <version>8.0.3</version>
</dependency>
  1. 配置logback
1
2
3
4
5
6
<appender name="Sentry" class="com.getsentry.raven.logback.SentryAppender">
    <dsn>https://username:password@sentry.abc.com/117</dsn>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        <level>ERROR</level>
    </filter>
</appender>