pypi python-json-logger 4.0.0

one day ago

4.0.0 - 2025-10-06

Added

  • Support DictConfigurator prefixes for rename_fields and static_fields. #45
    • Allows using values like ext://sys.stderr in fileConfig/dictConfig value fields.
  • 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.
  • Supports sequences of strings (e.g. lists and tuples) of field names for Formatter fmt. #16

Changed

  • Rename pythonjsonlogger.core.LogRecord and log_record arguments to avoid confusion / overlapping with logging.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.

Removed

  • Remove support for providing strings instead of objects when instantiating formatters. Instead use the DictConfigurator ext:// prefix format when using fileConfig/dictConfig. #47
    • Affects pythonjsonlogger.json.JsonFormatter: json_default, json_encoder, json_serializer.
    • Affects pythonjsonlogger.orjson.OrjsonFormatter: json_default.
    • Affects pythonjsonlogger.msgspec.MsgspecFormatter: json_default.

Thanks @rubensa

Don't miss a new python-json-logger release

NewReleases is sending notifications on new releases.