This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lukas.lalinsky
Recipients lukas.lalinsky
Date 2011-04-22.13:52:16
SpamBayes Score 1.110223e-16
Marked as misclassified No
Message-id <1303480338.6.0.255798757577.issue11907@psf.upfronthosting.co.za>
In-reply-to
Content
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/handlers.py", line 808, in emit
    self.socket.send(msg)
error: [Errno 40] Message too long
Logged from file <stdin>, line 1
History
Date User Action Args
2011-04-22 13:52:18lukas.lalinskysetrecipients: + lukas.lalinsky
2011-04-22 13:52:18lukas.lalinskysetmessageid: <1303480338.6.0.255798757577.issue11907@psf.upfronthosting.co.za>
2011-04-22 13:52:16lukas.lalinskylinkissue11907 messages
2011-04-22 13:52:16lukas.lalinskycreate