[Haskell-cafe] hslogger and syslog-ng

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Sun Aug 23 11:13:11 EDT 2009


On Aug 23, 2009, at 09:41 , Magnus Therning wrote:
> I'm having some problem with logging to syslog using System.Log.Logger
> and friends.  I have the following:
>
>> :m +System.Log.Logger
>> :m +System.Log.Handler.Syslog
>> sl <- openlog "foo" [PID] USER DEBUG
>> updateGlobalLogger rootLoggerName (addHandler sl)
>> warningM "bar" "test"
> *** Exception: sendTo: protocol error (Protocol wrong type for socket)
>
> What could be the cause for this?
> I've tried hsyslog and it reports to my instance of syslog without  
> problems.


Looks like hslogger assumes /dev/log is always a datagram socket;  
hsyslog uses the system openlog(), which correctly recognizes that  
syslog-ng uses a stream socket.  (Think UDP and TCP, respectively,  
except that there's no IP involved with local sockets.)

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090823/810aeb6f/PGP.bin


More information about the Haskell-Cafe mailing list