将哨兵日志记录与Elasticsearch结合使用 [英] Using sentry logging with elasticsearch

查看:136
本文介绍了将哨兵日志记录与Elasticsearch结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将所有日志存储在哨兵实例中.根据此线程,我尝试了以下操作:

I try to store all the logs at sentry instance. Accordingly to this thread I tried the following:

将哨兵附加程序添加到loggin.yml:

Added sentry appender to loggin.yml:

es.logger.level: INFO
rootLogger: ${es.logger.level}, console, sentry
...
appender:
  console:
    type: console
    layout:
      type: consolePattern
      conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"

  sentry: 
    type: net.kencochrane.raven.log4j.SentryAppender 
    dsn: "http://...@..."

并将raven-5.0.jarraven-log4j-5.0.jarraven-logback-5.0.jar复制到es/lib文件夹.启动过程中没有错误,但哨兵没有记录,即使在控制台上也有警告消息. ES的版本是2.1.0.

And copied raven-5.0.jar, raven-log4j-5.0.jar and raven-logback-5.0.jar to es/lib folder. No errors during start but sentry has no records even with warning messages at console. ES's version is 2.1.0.

我想念什么吗?

推荐答案

此处为ES 2.4.4的有效解决方案:

Here the valid solution (for ES 2.4.4):

  1. 将以下库添加到ES的lib文件夹中:raven-7.8.2.jarraven-log4j-7.8.2.jarslf4j-api-1.7.24.jarslf4j-log4j12-1.7.24.jar
  2. 更新config/logging.yml:

  1. Add following libraries to lib folder of ES: raven-7.8.2.jar, raven-log4j-7.8.2.jar, slf4j-api-1.7.24.jar, slf4j-log4j12-1.7.24.jar
  2. Update config/logging.yml:

rootLogger: ${es.logger.level}, console, file, sentry

/* other appenders */

sentry:
   type: com.getsentry.raven.log4j.SentryAppender 
   dsn: <DSN_HERE> 
   threshold: INFO

  • 重新启动ES实例
  • 这篇关于将哨兵日志记录与Elasticsearch结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆