1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-28 19:40:54 +00:00

Log exceptions (Fixes #447)

Exceptions were just written to stderr but not into logs.
This commit is contained in:
Unrud 2016-08-25 04:33:14 +02:00
parent c091399f5e
commit 3b71ab960e
2 changed files with 27 additions and 1 deletions

View file

@ -104,7 +104,11 @@ def run():
if not configuration_found:
logger.warning("Configuration file '%s' not found" % options.config)
serve(configuration, logger)
try:
serve(configuration, logger)
except Exception:
logger.exception("An exception occurred during server startup:")
exit(1)
def serve(configuration, logger):
@ -175,6 +179,7 @@ def serve(configuration, logger):
server_class.max_connections = configuration.getint(
"server", "max_connections")
RequestHandler.logger = logger
if not configuration.getboolean("server", "dns_lookup"):
RequestHandler.address_string = lambda self: self.client_address[0]