将哨兵日志记录与Elasticsearch结合使用 [英] Using sentry logging with elasticsearch
本文介绍了将哨兵日志记录与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.jar
,raven-log4j-5.0.jar
和raven-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):
- 将以下库添加到ES的
lib
文件夹中:raven-7.8.2.jar
,raven-log4j-7.8.2.jar
,slf4j-api-1.7.24.jar
,slf4j-log4j12-1.7.24.jar
-
更新
config/logging.yml
:
- 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
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
这篇关于将哨兵日志记录与Elasticsearch结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文