2

I have a question on how to configure correctly to get rails logger.error message showing up in SysLog. We used SyslogLogger gem. In our Syslog config, we have filter like this:

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                         ~

When there is exception or fatal error, the log of stack trace will be showing up. However, any statements that we use logger.error to log them are not showing up.

   

Prakash Murthy
  • 12,923
  • 3
  • 46
  • 74
DrChanimal
  • 681
  • 5
  • 10

1 Answers1

0

It appears you need to comment out #config.logger in config/environments/production.rb.

After that, you can set config.logger = SyslogLogger.new or for a distributed setup config.logger = SyslogLogger.new "myApp".

You can check out this blog post or this stackoverflow post for more information.

Community
  • 1
  • 1
David Hahn
  • 740
  • 9
  • 26
  • That is not the issue. We have that configure correctly in production.rb. The issue is how to set syslog filter correctly. Exception in rails show up in syslog. It is just logger.error didn't show up – DrChanimal Feb 08 '13 at 15:41