Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit ac42b20

Browse files
committed
Set exc_info to exc_text (if available) and if exc_info is not set
1 parent 6425c16 commit ac42b20

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pythonjsonlogger/jsonlogger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ def format(self, record):
124124
# user-supplied dict.
125125
if record.exc_info and not message_dict.get('exc_info'):
126126
message_dict['exc_info'] = self.formatException(record.exc_info)
127+
if not message_dict.get('exc_info') and record.exc_text:
128+
message_dict['exc_info'] = record.exc_text
127129

128130
try:
129131
log_record = OrderedDict()

0 commit comments

Comments
 (0)