From 2963c620d65d8e6de7b1d93578b7bca3d250a520 Mon Sep 17 00:00:00 2001 From: Stefan Heinemann Date: Fri, 10 Jan 2025 11:41:46 +0100 Subject: [PATCH] PB-931 Don't add exc_text manually to logging output in JSON formatter Remove the addition of exc_text to the message directly. Instead adding it to the record, so that it can be formatted through the django logging facility --- logging_utilities/formatters/json_formatter.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/logging_utilities/formatters/json_formatter.py b/logging_utilities/formatters/json_formatter.py index 09bc162..9469efc 100644 --- a/logging_utilities/formatters/json_formatter.py +++ b/logging_utilities/formatters/json_formatter.py @@ -354,9 +354,6 @@ def format(self, record): if self.add_always_extra: self._add_extra_to_message(extra, message) - if record.exc_text: - message['exc_text'] = record.exc_text - if record.stack_info: message['stack_info'] = self.formatStack(record.stack_info)