[issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers

Kirill Pinchuk report at bugs.python.org
Wed Jun 2 14:31:52 EDT 2021


New submission from Kirill Pinchuk <cybergrind at gmail.com>:

Probably we should make the behavior of SysLogHandler consistent with other Socket handlers.

Right now SocketHandler and DatagramHandler implement such behavior:

1) on `close` set `self.socket = None`
2) when trying to send - make socket when it is None


SysLogHandler doesn't implement this behavior and when you close the socket for some reason (eg. restart of uWSGI server on code change) it leaves it in the closed state, then raises an error when you try to send any message because it is closed

```
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/handlers.py", line 959, in emit
    self.socket.sendto(msg, self.address)
OSError: [Errno 9] Bad file descriptor

```

----------
components: Library (Lib)
messages: 394932
nosy: Kirill Pinchuk
priority: normal
severity: normal
status: open
title: Unify logging.handlers.SysLogHandler behavior with SocketHandlers
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44291>
_______________________________________


More information about the Python-bugs-list mailing list