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.
Still an issue with 1.3.1.0.
[pid 26413] connect(4, {sa_family=AF_UNIX, sun_path="/dev/log"}, 110) = -1 EPROTOTYPE (Protocol wrong type for socket)
The problematic code is at https://github.com/haskell-hvr/hslogger/blob/master/src/System/Log/Handler/Syslog.hs#L185
Okay, nvm: after patching up opening it fails the same way, gotta investigate more.
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.