haskell-hvr/hslogger

Syslog handler doesn't work with metalog

Opened this issue · 5 comments

I use metalog http://metalog.sourceforge.net/ on my development machines so I don't have to fiddle with logrotate all the time. I noticed that the following doesn't log anything when using metalog:

  Prelude> :set prompt "ghci> "
  ghci> :m +System.Log.Logger
  ghci> :m +System.Log.Handler.Syslog
  ghci> sl <- openlog rootLoggerName [] USER DEBUG
  ghci> updateGlobalLogger rootLoggerName (addHandler sl)
  ghci> errorM rootLoggerName "This won't show up with metalog."

If however I stop metalog and start syslog-ng, everything works as expected.

l29ah commented

Still an issue with 1.3.1.0.

l29ah commented

[pid 26413] connect(4, {sa_family=AF_UNIX, sun_path="/dev/log"}, 110) = -1 EPROTOTYPE (Protocol wrong type for socket)

l29ah commented

Okay, nvm: after patching up opening it fails the same way, gotta investigate more.

l29ah commented

metalog doesn't like the syntax of messages sent by hslogger, not sure why: i don't understand how it relates to the Syslog Protocol RFC, since seems like neither logger(1) nor hslogger emit compliant messages, but metalog is satisfied by the former's.