日志记录堆栈跟踪日志appender
我想在stack-trace
logstash log appender而不是在消息
字段中
public void exceptionsCatcher(JoinPoint joinPoint, RuntimeException e) {
...
log.error("exception : {} ", e);
...
}
我搜索刚刚找到了使用grok
从消息字段过滤堆栈 - 跟踪的解决方案,我想在应用程序级别将其设置在堆栈 - 跟踪字段中,而不是在中设置logstash
过滤器。
I would like to log the exception stack trace in stack-trace
field of logstash log appender instead of being inside the message
field
public void exceptionsCatcher(JoinPoint joinPoint, RuntimeException e) {
...
log.error("exception : {} ", e);
...
}
I searched throw community and just found solution with grok
to filter out stack-trace from message field, what i would like is to set it at stack-trace field in application level and not in logstash
filter .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要额外的配置即可这样做,只需使用日志提供商的正确超载方法,例如,
第三个标记将堆栈跟踪插入
stack-trace
属性,在<<< a href =“ https://www.slf4j.org/api/org/slf4j/logger.html” rel =“ nofollow noreferrer”>在这里。You don't need extra configuration to do so just use proper overloaded method of your log provider, for example
The third marker will ingest stack trace into
stack-trace
attribute, find more about other overloaded methods in here.