maven

        <dependency>
            <groupId>com.getsentry.raven</groupId>
            <artifactId>raven-logback</artifactId>
            <version>8.0.3</version>
        </dependency>

配置logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/base.xml"/>
    <jmxConfigurator/>

    <appender name="SENTRY" class="com.getsentry.raven.logback.SentryAppender">
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>ERROR</level>
        </filter>
    </appender>

    <root level="INFO">
        <appender-ref ref="CONSOLE" />
        <appender-ref ref="FILE" />
        <appender-ref ref="SENTRY" />
    </root>
</configuration>

配置环境变量

SENTRY_ENVIRONMENT=test
SENTRY_DSN=http://1d59201178e540ec8172870df4413aa2:20131e8bb98c4ab48693e4f9cd6ef98a@192.168.99.100:9000/2

想获取最新内容,请关注微信公众号
图片描述


codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...


引用和评论

0 条评论