Skip to content

chore(deps): update dependency python-json-logger to v4 - #3127

Merged
gcf-merge-on-green[bot] merged 1 commit into
GoogleCloudPlatform:mainfrom
renovate-bot:renovate/python-json-logger-4.x
Oct 20, 2025
Merged

gcf-merge-on-green[bot] merged 1 commit into
GoogleCloudPlatform:mainfrom
renovate-bot:renovate/python-json-logger-4.x

Conversation

@renovate-bot

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
python-json-logger ==3.3.0 -> ==4.0.0 age confidence

Release Notes

nhairs/python-json-logger (python-json-logger)

v4.0.0: 4.0.0

Compare Source

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

v3.3.0: 3.3.0

Compare Source

Added
  • exc_info_as_array and stack_info_as_array options are added to pythonjsonlogger.core.BaseJsonFormatter allowing both to be encoded as list of lines instead of a single multi-line string. #​35
Security
  • Remove msgspec-python313-pre from dev dependencies preventing potential RCE. Details: GHSA-wmxh-pxcx-9w24

Thanks @​1hakusai1 and @​omnigodz

v3.2.1: 3.2.1

Compare Source

Fixed
  • Import error on import pythonjsonlogger.jsonlogger #​29

v3.2.0: 3.2.0

Compare Source

Changed
  • pythonjsonlogger.[ORJSON,MSGSPEC]_AVAILABLE no longer imports the respective package when determining availability.
  • pythonjsonlogger.[orjson,msgspec] now throws a pythonjsonlogger.exception.MissingPackageError when required libraries are not available. These contain more information about what is missing whilst still being an ImportError.
  • defaults parameter is no longer ignored and now conforms to the standard library. Setting a defaults dictionary will add the specified keys if the those keys do not exist in a record or weren't passed by the extra parameter when logging a message.
  • typing_extensions is only installed on Python version < 3.10.
  • Support Python 3.13
    • msgspec has only been tested against pre-release versions.

Thanks @​cjwatson and @​bharel

v3.1.0

Compare Source

This splits common funcitonality out to allow supporting other JSON encoders. Although this is a large refactor, backwards compatibility has been maintained.

Added
  • pythonjsonlogger.core - more details below.
  • pythonjsonlogger.defaults module that provides many functions for handling unsupported types.
  • Orjson encoder support via pythonjsonlogger.orjson.OrjsonFormatter with the following additions:
    • bytes are URL safe base64 encoded.
    • Exceptions are "pretty printed" using the exception name and message e.g. "ValueError: bad value passed"
    • Enum values use their value, Enum classes now return all values as a list.
    • Tracebacks are supported
    • Classes (aka types) are support
    • Will fallback on __str__ if available, else __repr__ if available, else will use __could_not_encode__
  • MsgSpec encoder support via pythonjsonlogger.msgspec.MsgspecFormatter with the following additions:
    • Exceptions are "pretty printed" using the exception name and message e.g. "ValueError: bad value passed"
    • Enum classes now return all values as a list.
    • Tracebacks are supported
    • Classes (aka types) are support
    • Will fallback on __str__ if available, else __repr__ if available, else will use __could_not_encode__
    • Note: msgspec only supprts enum values of type int or str jcrist/msgspec#680
Changed
  • pythonjsonlogger.jsonlogger has been moved to pythonjsonlogger.json with core functionality moved to pythonjsonlogger.core.
  • pythonjsonlogger.core.BaseJsonFormatter properly supports all logging.Formatter arguments:
    • fmt is unchanged.
    • datefmt is unchanged.
    • style can now support non-standard arguments by setting validate to False
    • validate allows non-standard style arguments or prevents calling validate on standard style arguments.
    • default is ignored.
  • pythonjsonlogger.json.JsonFormatter default encodings changed:
    • bytes are URL safe base64 encoded.
    • Exception formatting detected using BaseException instead of Exception. Now "pretty prints" the exception using the exception name and message e.g. "ValueError: bad value passed"
    • Dataclasses are now supported
    • Enum values now use their value, Enum classes now return all values as a list.
    • Will fallback on __str__ if available, else __repr__ if available, else will use __could_not_encode__
  • Renaming fields now preserves order (#​7) and ignores missing fields (#​6).
  • Documentation
    • Generated documentation using mkdocs is stored in docs/
    • Documentation within README.md has been moved to docs/index.md and docs/qucikstart.md.
    • CHANGELOG.md has been moved to docs/change-log.md
    • SECURITY.md has been moved and replaced with a symbolic link to docs/security.md.
Deprecated
  • pythonjsonlogger.jsonlogger is now pythonjsonlogger.json
  • pythonjsonlogger.jsonlogger.RESERVED_ATTRS is now pythonjsonlogger.core.RESERVED_ATTRS.
  • pythonjsonlogger.jsonlogger.merge_record_extra is now pythonjsonlogger.core.merge_record_extra.
Removed
  • Python 3.7 support dropped
  • pythonjsonlogger.jsonlogger.JsonFormatter._str_to_fn replaced with pythonjsonlogger.core.str_to_object.

v3.0.1

Compare Source

Fixes

v3.0.0

Compare Source

Note: using new major version to separate changes from this fork and the original (upstream). See #​1 for details.

Changes
  • Update supported Python versions - @​nhairs
    • Drop 3.6
    • The following versions are supported and tested:
      • CPython 3.7-3.12 (ubuntu, windows, mac)
      • PyPy 3.7-3.10 (ubuntu, wundows, mac)
    • RESERVED_ATTRS is now a list and version dependent
  • Fix JsonFormatter.__init__ return type (None) - @​nhairs
  • Moved to pyproject.toml - @​nhairs
  • Update linting and testing - @​nhairs
    • Split lint and test steps in GHA
    • Use validate-pyproject, black, pylint, mypy

New Contributors

Full Changelog: nhairs/python-json-logger@v2.0.7...v3.0.0


Configuration

📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@forking-renovate forking-renovate Bot added dependencies Pull requests that update a dependency file lang: python Issues specific to Python. labels Oct 20, 2025
@renovate-bot
renovate-bot requested a review from a team as a code owner October 20, 2025 03:55
@forking-renovate

Copy link
Copy Markdown

⚠️ Artifact update problem

Renovate failed to update artifacts related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: src/recommendationservice/requirements.txt
Command failed: pip-compile requirements.in
  ERROR: Cannot install -r requirements.in (line 1), -r requirements.in (line 2) and -r requirements.in (line 3) because these package versions have conflicting dependencies.
Discarding protobuf==4.25.0 (from -r requirements.txt (line 89)) to proceed the resolution
  ERROR: Cannot install -r requirements.in (line 3) because these package versions have conflicting dependencies.
Discarding grpcio==1.59.2 (from -r requirements.txt (line 43)) to proceed the resolution
  ERROR: Cannot install -r requirements.in (line 7) and -r requirements.in (line 8) because these package versions have conflicting dependencies.
Discarding opentelemetry-instrumentation==0.41b0 (from -r requirements.txt (line 70)) to proceed the resolution
  ERROR: Cannot install -r requirements.in (line 7) and -r requirements.in (line 8) because these package versions have conflicting dependencies.
Traceback (most recent call last):
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 98, in resolve
    result = self._result = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 596, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 537, in resolve
    raise ResolutionImpossible(self.state.backtrack_causes)
pip._vendor.resolvelib.resolvers.exceptions.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('opentelemetry-instrumentation==0.41b0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/42/91/cfc4f202811105e4c90e9d7e3091a0ab3ee00cc45c61fc7a10a9ec87181a/opentelemetry_distro-0.41b0-py3-none-any.whl (from https://pypi.org/simple/opentelemetry-distro/) (requires-python:>=3.7)')), RequirementInformation(requirement=SpecifierRequirement('opentelemetry-instrumentation==0.58b0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/94/3a/119a81022f918017e68aab6e13949fa10d5c82a6b01dfff3666dc8b7fb51/opentelemetry_instrumentation_grpc-0.58b0-py3-none-any.whl (from https://pypi.org/simple/opentelemetry-instrumentation-grpc/) (requires-python:>=3.9)'))]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/bin/pip-compile", line 7, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/core.py", line 1462, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/core.py", line 1383, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/core.py", line 1246, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/core.py", line 814, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/decorators.py", line 34, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/piptools/scripts/compile.py", line 479, in cli
    results = resolver.resolve(max_rounds=max_rounds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/piptools/resolver.py", line 635, in resolve
    is_resolved = self._do_resolve(
                  ^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/piptools/resolver.py", line 670, in _do_resolve
    resolver.resolve(
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 107, in resolve
    raise error from e
pip._internal.exceptions.DistributionNotFound: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

File name: src/emailservice/requirements.txt
Command failed: pip-compile requirements.in
  ERROR: Cannot install -r requirements.in (line 1) and -r requirements.in (line 2) because these package versions have conflicting dependencies.
Discarding protobuf==4.25.0 (from -r requirements.txt (line 104)) to proceed the resolution
  ERROR: Cannot install -r requirements.in (line 3) because these package versions have conflicting dependencies.
Discarding typing-extensions==4.8.0 (from -r requirements.txt (line 131)) to proceed the resolution
  ERROR: Cannot install -r requirements.in (line 10) and -r requirements.in (line 9) because these package versions have conflicting dependencies.
Discarding opentelemetry-instrumentation==0.41b0 (from -r requirements.txt (line 83)) to proceed the resolution
  ERROR: Cannot install -r requirements.in (line 10) and -r requirements.in (line 9) because these package versions have conflicting dependencies.
Traceback (most recent call last):
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 98, in resolve
    result = self._result = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 596, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 537, in resolve
    raise ResolutionImpossible(self.state.backtrack_causes)
pip._vendor.resolvelib.resolvers.exceptions.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('opentelemetry-instrumentation==0.41b0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/42/91/cfc4f202811105e4c90e9d7e3091a0ab3ee00cc45c61fc7a10a9ec87181a/opentelemetry_distro-0.41b0-py3-none-any.whl (from https://pypi.org/simple/opentelemetry-distro/) (requires-python:>=3.7)')), RequirementInformation(requirement=SpecifierRequirement('opentelemetry-instrumentation==0.58b0'), parent=LinkCandidate('https://files.pythonhosted.org/packages/94/3a/119a81022f918017e68aab6e13949fa10d5c82a6b01dfff3666dc8b7fb51/opentelemetry_instrumentation_grpc-0.58b0-py3-none-any.whl (from https://pypi.org/simple/opentelemetry-instrumentation-grpc/) (requires-python:>=3.9)'))]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/bin/pip-compile", line 7, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/core.py", line 1462, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/core.py", line 1383, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/core.py", line 1246, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/core.py", line 814, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/click/decorators.py", line 34, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/piptools/scripts/compile.py", line 479, in cli
    results = resolver.resolve(max_rounds=max_rounds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/piptools/resolver.py", line 635, in resolve
    is_resolved = self._do_resolve(
                  ^^^^^^^^^^^^^^^^^
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/piptools/resolver.py", line 670, in _do_resolve
    resolver.resolve(
  File "/opt/containerbase/tools/pip-tools/7.5.1/3.11.14/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 107, in resolve
    raise error from e
pip._internal.exceptions.DistributionNotFound: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

@renovate-bot renovate-bot added dependencies Pull requests that update a dependency file lang: python Issues specific to Python. labels Oct 20, 2025
@yoshi-approver yoshi-approver added the automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit label Oct 20, 2025
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit f5697b2 into GoogleCloudPlatform:main Oct 20, 2025
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit label Oct 20, 2025
@renovate-bot
renovate-bot deleted the renovate/python-json-logger-4.x branch October 20, 2025 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file lang: python Issues specific to Python.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants