我有一个关于如何正确配置以使 railslogger.error
消息显示在SysLog
. 我们用SyslogLogger gem
. 在我们的Syslog config
中,我们有这样的过滤器:
if $programname == 'rails' and ($syslogseverity-text == 'emerg') then @somehost
if $programname == 'rails' and ($syslogseverity-text == 'alert') then @somehost
if $programname == 'rails' and ($syslogseverity-text == 'crit') then @somehost
if $programname == 'rails' and ($syslogseverity-text == 'err') then @somehost
if $programname == 'rails' and ($syslogseverity-text == 'warn') then @somehost
if $programname == 'rails' then ~
当出现异常或致命错误时,将显示堆栈跟踪日志。但是,我们logger.error
用来记录它们的任何语句都没有显示出来。