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 elelement
Recipients elelement, vinay.sajip
Date 2016-10-17.13:27:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476710845.52.0.909947294675.issue28404@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry to bother you again, but I've tested this not only with Fluentd, but with a RSYSLOG server and it does not work with TCP except if you manually add the trailer LF character. Other than that, UDP default transport protocol has no issues and works fine with both systems. Here's my simple code:

-------
sHandler = logging.handlers.SysLogHandler(address=(address[0], address[1]), socktype = socket.SOCK_STREAM)
sHandler.setFormatter(logging.Formatter(fmt=MSG_SYSLOG_FORMAT, datefmt=DATE_FMT))
self.addHandler(sHandler)
-------

After reading RFC 6587 I think the SyslogHandler class should implement at least one of the framing mechanisms proposed by this RFC, meant for TCP transmission:
- Octet counting
- Trailer character (e.g. LF)

Besides, I've being checking out the library "pyloggr" (https://github.com/stephane-martin/pyloggr) and they are implementing both mechanisms. As for SyslogHandler, it will be as simple as adding another field to the class constructor (use_delimiter?) and to add these lines to the emit code (it works):

-------
if (self.use_delimiter):
    msg = msg + '\n'
else:
    msg = str(len(msg)) + ' ' + msg # default behavior
-------

Thank you again
History
Date User Action Args
2016-10-17 13:27:25elelementsetrecipients: + elelement, vinay.sajip
2016-10-17 13:27:25elelementsetmessageid: <1476710845.52.0.909947294675.issue28404@psf.upfronthosting.co.za>
2016-10-17 13:27:25elelementlinkissue28404 messages
2016-10-17 13:27:24elelementcreate