Author lukas.lalinsky
Recipients lukas.lalinsky
Date 2011-04-22.13:52:16
SpamBayes Score 1.11022e-16
Marked as misclassified No
Message-id <>
It seems that logging.handlers.SysLogHandler can't handle messages that can't be passed atomically via the socket. I'm not sure what is the right behavior (the syslog() function truncates the message), but I think it shouldn't propagate the exception to the application.

Python 2.7.1 (r271:86832, Apr 18 2011, 08:47:29) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging.handlers
>>> handler = logging.handlers.SysLogHandler('/dev/log')
>>> logger = logging.getLogger()
>>> logger.addHandler(handler)
>>> logger.warn('x' * 4096)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/logging/", line 808, in emit
error: [Errno 40] Message too long
Logged from file <stdin>, line 1
Date User Action Args
2011-04-22 13:52:18lukas.lalinskysetrecipients: + lukas.lalinsky
2011-04-22 13:52:18lukas.lalinskysetmessageid: <>
2011-04-22 13:52:16lukas.lalinskylinkissue11907 messages
2011-04-22 13:52:16lukas.lalinskycreate