4.0.0 - 2025-10-06
Added
- Support
DictConfigurator
prefixes forrename_fields
andstatic_fields
. #45- Allows using values like
ext://sys.stderr
infileConfig
/dictConfig
value fields.
- Allows using values like
- Support comma seperated lists for Formatter
fmt
(style=","
) e.g."asctime,message,levelname"
#15- Note that this style is specific to
python-json-logger
and thus care should be taken not to pass this format to other logging Formatter implementations.
- Note that this style is specific to
- Supports sequences of strings (e.g. lists and tuples) of field names for Formatter
fmt
. #16
Changed
- Rename
pythonjsonlogger.core.LogRecord
andlog_record
arguments to avoid confusion / overlapping withlogging.LogRecord
. #38- Affects arguments to
pythonjsonlogger.core.BaseJsonFormatter
(and any child classes).serialize_log_record
add_fields
jsonify_log_record
process_log_record
- Note: functions referring to
log_record
have not had their function name changed.
- Affects arguments to
Removed
- Remove support for providing strings instead of objects when instantiating formatters. Instead use the
DictConfigurator
ext://
prefix format when usingfileConfig
/dictConfig
. #47- Affects
pythonjsonlogger.json.JsonFormatter
:json_default
,json_encoder
,json_serializer
. - Affects
pythonjsonlogger.orjson.OrjsonFormatter
:json_default
. - Affects
pythonjsonlogger.msgspec.MsgspecFormatter
:json_default
.
- Affects
Thanks @rubensa