[Haskell-cafe] hslogger and syslog-ng

Magnus Therning magnus at therning.org
Sun Aug 23 11:33:39 EDT 2009


Brandon S. Allbery KF8NH wrote:
> 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.)

Oh, though logging to a dgram socket doesn't seem to work either.

I added the following line to /etc/syslog-ng.conf:

   unix-dgram("/dev/dlog");

Restarted it and checked that the socket was there.  Then I ran the following:

   > :m +System.Log.Logger
   > :m +System.Log.Handler.Syslog
   > sl <- openlog_local "/dev/dlog" "foo" [PID] USER DEBUG
   > updateGlobalLogger rootLoggerName (addHandler sl)
   > warningM "bar" "test"
   *** Exception: sendTo: protocol error (Protocol wrong type for socket)

Still the same result :-(

/M

-- 
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090823/e27d8365/signature.bin


More information about the Haskell-Cafe mailing list