[New-bugs-announce] [issue21807] SysLogHandler closes TCP connection after first message

Omer Katz report at bugs.python.org
Thu Jun 19 10:12:08 CEST 2014


New submission from Omer Katz:

import logging
import logging.handlers
import socket

logger = logging.getLogger('mylogger')
handler = logging.handlers.SysLogHandler(('****', logging.handlers.SYSLOG_TCP_PORT), socktype=socket.SOCK_STREAM)
formatter = logging.Formatter('%(name)s: [%(levelname)s] %(message)s')
handler.setFormatter(formatter)

logger.addHandler(handler)

logger.info("TEST 1")
logger.info("TEST 2")

I have verified that this code only sends 'TEST 1' to Splunk and syslog-ng on both Python 2.7 and Python 3.4. After that, the connection appears closed. UDP on the other hand works just fine.

----------
components: Library (Lib)
messages: 220961
nosy: Omer.Katz
priority: normal
severity: normal
status: open
title: SysLogHandler closes TCP connection after first message
versions: Python 2.7, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21807>
_______________________________________


More information about the New-bugs-announce mailing list