mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Log systemd journal connection error
This commit is contained in:
parent
77626e5aed
commit
a2be03fdaf
1 changed files with 4 additions and 1 deletions
|
@ -133,10 +133,13 @@ class ThreadedStreamHandler(logging.Handler):
|
|||
journal_socket = socket.socket(
|
||||
socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
journal_socket.connect("/run/systemd/journal/socket")
|
||||
except OSError:
|
||||
except OSError as e:
|
||||
self._journal_socket_failed = True
|
||||
if journal_socket:
|
||||
journal_socket.close()
|
||||
# Log after setting `_journal_socket_failed` to prevent loop!
|
||||
logger.error("Failed to connect to systemd journal: %s",
|
||||
e, exc_info=True)
|
||||
return False
|
||||
self._journal_socket = journal_socket
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue