Skip to content

Commit 403d822

Browse files
authored
Merge pull request #92 from Exagone313/stringify-unserializable-extra
improve: convert unserializable attributes to str in JSON serializer
2 parents 5769f51 + 6945e1b commit 403d822

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

json_logging/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
ENABLE_JSON_LOGGING_DEBUG = False
2121
EMPTY_VALUE = '-'
2222
CREATE_CORRELATION_ID_IF_NOT_EXISTS = True
23-
JSON_SERIALIZER = lambda log: json.dumps(log, ensure_ascii=False)
23+
JSON_SERIALIZER = lambda log: json.dumps(log, ensure_ascii=False, default=str)
2424
CORRELATION_ID_HEADERS = ['X-Correlation-ID', 'X-Request-ID']
2525
COMPONENT_ID = EMPTY_VALUE
2626
COMPONENT_NAME = EMPTY_VALUE

0 commit comments

Comments
 (0)