José Manuel added the comment:

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)

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 
- Octet counting
- Trailer character (e.g. LF)

Besides, I've being checking out the library "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'
    msg = str(len(msg)) + ' ' + msg # default behavior

Thank you again

status: closed -> pending

Python tracker <>
Python-bugs-list mailing list

Reply via email to