本文介绍了NXlog在发送到Papertrail时会忽略多行tomcat堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我能够从rsyslog(v-8.13.0)到一个普通的nxlog服务器获取stacktrace [exceptions],该服务器将日志发送到papertrail服务器.但是nxlog服务器会忽略这些多行日志以进行纸质跟踪.我知道nxlog中有一个模块(xm_multiline)可以对此进行解析,但不确定如何将其与我当前的nxlog配置文件集成:
I am able get the stacktrace[exceptions] from rsyslog (v-8.13.0) to a common nxlog server which sends the logs to a papertrail server. But the nxlog server ignores these multiline logs to papertrail. I know there is a module (xm_multiline) in nxlog which can parse this, but not sure on how to integrate this with my current nxlog configuration file:
########################################
# Global directives #
########################################
User nxlog
Group nxlog
LogFile /var/log/nxlog/nxlog.log
LogLevel INFO
########################################
# Modules #
########################################
<Extension _syslog>
Module xm_syslog
</Extension>
<Input in1>
Module im_udp
Host 0.0.0.0
Port 514
Exec parse_syslog_bsd();
</Input>
<Input in2>
Module im_tcp
HOST 0.0.0.0
Port 1514
</Input>
<Output papertrail>
Module om_udp
Host papertrail.com
Port 24785
</Output>
<Output fileout1>
Module om_file
File "/var/log/nxlog/" + $Hostname + ".log"
Exec if $Message =~ /error/ $SeverityValue = syslog_severity_value("error");
Exec to_syslog_bsd();
</Output>
<Output fileout2>
Module om_file
File "/var/log/nxlog/logmsg2.txt"
</Output>
########################################
# Routes #
########################################
<Route 1>
Path in1 => fileout1,papertrail
</Route>
<Route tcproute>
Path in2 => fileout2
</Route>
任何帮助将不胜感激
推荐答案
我现在可以使用以下用于tomcat stacktrace的日志将日志发送到papertrail.
I am now able to send my logs to papertrail using the following for tomcat stacktrace.
<Extension multiline>
Module xm_multiline
HeaderLine /^/
EndLine //
</Extension>
这篇关于NXlog在发送到Papertrail时会忽略多行tomcat堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!