Skip to content

Commit

Permalink
improve: convert unserializable attributes to str in JSON serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Exagone313 committed Nov 4, 2022
1 parent 5769f51 commit 6945e1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion json_logging/__init__.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
ENABLE_JSON_LOGGING_DEBUG = False
EMPTY_VALUE = '-'
CREATE_CORRELATION_ID_IF_NOT_EXISTS = True
JSON_SERIALIZER = lambda log: json.dumps(log, ensure_ascii=False)
JSON_SERIALIZER = lambda log: json.dumps(log, ensure_ascii=False, default=str)
CORRELATION_ID_HEADERS = ['X-Correlation-ID', 'X-Request-ID']
COMPONENT_ID = EMPTY_VALUE
COMPONENT_NAME = EMPTY_VALUE

0 comments on commit 6945e1b

Please sign in to comment.