From 61c8633c5d834e24c8d5473df522efa849a60e8d Mon Sep 17 00:00:00 2001 From: LittlePony Date: Wed, 5 Feb 2020 22:40:44 +0300 Subject: [PATCH] Add logger traceback on application error. (#308) --- daphne/server.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/daphne/server.py b/daphne/server.py index f441285..5ede808 100755 --- a/daphne/server.py +++ b/daphne/server.py @@ -21,7 +21,6 @@ else: import logging import time -import traceback from concurrent.futures import CancelledError from twisted.internet import defer, reactor @@ -283,13 +282,10 @@ class Server(object): # Protocol is asking the server to exit (likely during test) self.stop() else: - exception_output = "{}\n{}{}".format( - exception, - "".join(traceback.format_tb(exception.__traceback__)), - " {}".format(exception), - ) logger.error( - "Exception inside application: %s", exception_output + "Exception inside application: %s", + exception, + exc_info=exception, ) if not disconnected: protocol.handle_exception(exception)