原文地址:http://luxuryzh.iteye.com/blog/1980364

 

Java代码  使用开源软件sentry来收集日志
  1. <dependency>  
  2. <groupId>net.kencochrane.raven</groupId>  
  3. <artifactId>raven-logback</artifactId>  
  4. <version>4.1.1</version>  
  5. </dependency>  

<!-- jaskson configuration --> 
Java代码  使用开源软件sentry来收集日志
  1. <dependency>  
  2. <groupId>com.fasterxml.jackson.core</groupId>  
  3. <artifactId>jackson-core</artifactId>  
  4. <version>2.3.0</version>  
  5. </dependency>  

<!-- sentry appender configuration --> 
Java代码  使用开源软件sentry来收集日志
  1. <appender name="Sentry" class="net.kencochrane.raven.logback.SentryAppender">  
  2. <dsn>  
  3. http://your api key@your sentry host/4  
  4. </dsn>  
  5. <filter class="ch.qos.logback.classic.filter.ThresholdFilter">  
  6. <level>ERROR</level>  
  7. </filter>  
  8. </appender>  

dsn中需要配置api keys,这个在sentry的项目配置中可以得到,一切就是这么简单,无缝集成,不影响现有的日志打印,还能帮助收集异常、统计异常,多好的事情,呵呵,下面附上一张我们部署的sentry系统的截图,敏感信息用线条抹去了请谅解。 
使用开源软件sentry来收集日志

相关文章:

  • 2021-06-20
  • 2021-08-24
  • 2021-04-07
  • 2022-01-05
  • 2021-06-17
  • 2022-12-23
  • 2021-08-04
  • 2021-09-02
猜你喜欢
  • 2021-06-12
  • 2021-07-15
  • 2021-09-21
  • 2021-03-31
  • 2022-12-23
相关资源
相似解决方案