From d6eb7968932f9dee55b57285b633fb7d46ac6ee3 Mon Sep 17 00:00:00 2001 From: Ricardo Lima Canela Date: Wed, 6 Feb 2019 14:12:04 -0300 Subject: [PATCH] Insere excecoes no log (#2473) * adicionando ao log qualquer excecao que ocorra no django * apagando comentarios desnecessarios --- sapl/settings.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/sapl/settings.py b/sapl/settings.py index d616a446f..237b137d7 100755 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -340,6 +340,11 @@ LOGGING = { 'level': 'INFO', 'propagate': True, }, + 'django': { + 'handlers': ['applogfile'], + 'level': 'ERROR', + 'propagate': True, + }, } } @@ -358,15 +363,3 @@ def remove_warnings(): remove_warnings() - - -def uncaught_exceptions(type, value, error_traceback): - import traceback - logger = logging.getLogger(__name__) - error_msg = ''.join(traceback.format_tb(error_traceback)) - logger.error(error_msg) - print(error_msg) - - -# captura exceções que não foram tratadas -sys.excepthook = uncaught_exceptions