Using sentry logging with elasticsearch

旧街凉风 提交于 2019-12-24 15:27:40

问题


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

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://...@..."

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.

Do I miss something?


回答1:


Here the valid solution (for ES 2.4.4):

  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
    
  3. Restart ES instance


来源:https://stackoverflow.com/questions/34894776/using-sentry-logging-with-elasticsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!