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 ```
> right now it has reconnection logic for unixsocket but not for tcp/udp Should it not have UDP/TCP supported as well as domain sockets, before being reviewed?
Oh, sorry bad wording. The current implementation has reconnection logic only for UNIX sockets The patch adds reconnection logic for UDP/TCP sockets as well. I've done it with minimal changes to the existing code to accomplish that. And probably it can be merged. But in general, it looks like we can refactor SysLogHandler to inherit from SocketHandler. Not sure if it should be done in this PR or better to create separate?
> Oh, sorry bad wording. OK, I see. Will take a look soon. > it looks like we can refactor SysLogHandler to inherit from SocketHandler. Not sure if it should be done in this PR Better a separate PR for that, I feel. Removing the older Pythons from the issue, as this is an enhancement request.