unstale

pypi / structlog

structlog

What changed in structlog 25 to 26, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.

2 breaking2 deprecations15 new APIs and options1 behavior and defaults15 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.1 on npm

structlog 2612 changes

Breaking changes 1

Deprecations 1

  • Support for better-exceptions is deprecated and will be removed within a year; use the Rich integration or copy-paste the suggested one line of code.

    26.1.0release notes

New APIs and options 5

  • Adds a name attribute, allowing use with the structlog.stdlib.add_logger_name() processor without the standard library integration.

    26.1.0release notes

  • Adds Rich-based monochrome exception rendering, supported throughout ConsoleRenderer when the user asks for no colors.

    26.1.0release notes

  • Adds the qualified import name of the callsite module, or __main__ for the entry point; this is available only for structlog-originated events.

    26.1.0release notes

  • Adds the snake_case alias get_effective_level() for getEffectiveLevel(), improving compatibility with FilteringBoundLogger and allowing configurations to be swapped without changing call sites.

    26.1.0release notes

  • Adds the snake_case alias is_enabled_for() for isEnabledFor(), improving compatibility with FilteringBoundLogger and allowing configurations to be swapped without changing call sites.

    26.1.0release notes

Behavior and default changes 1

  • No longer warns when the exception key has a rendered value despite a fancy formatter being configured.

    26.1.0release notes

Fixes and other changes 4

  • Python 3.15 support was added.

    26.1.0release notes

  • These loggers now hold weak references to output files, preventing file leakage in long-running processes that open many logfiles.

    26.1.0release notes

  • For async log methods, reports the calling thread's id and name instead of those of the executor-pool thread running the underlying synchronous logger.

    26.1.0release notes

  • WriteLogger is usable after unpickling.

    26.1.0release notes

structlog 2523 changes

Breaking changes 1

  • Renamed the pad_event argument to pad_event_to to distinguish it from the boolean pad_level argument.

    25.5.0release notes

Deprecations 1

  • The pad_event argument is deprecated; use pad_event_to to distinguish it from the boolean pad_level argument.

    25.5.0release notes

New APIs and options 10

  • Native loggers now accept a dictionary for dictionary-based interpolation.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • The attribute can now be set, allowing developers to change exception formatting, including disabling pretty-printing.

    25.5.0release notes

  • Added get_active() to retrieve the currently active ConsoleRenderer instance.

    25.5.0release notes

  • Added a method to reuse the default column styles.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • Exposes Rich's upstream code_width parameter.

    25.5.0release notes

  • On Python 3.11+, QUAL_NAME adds the qualified name of a structlog-originated callsite, including scope and class names.

    25.5.0release notes

  • LoggerFactory now supports the stacklevel parameter.

    25.5.0release notes

  • capture_logs() optionally accepts processors to apply before capture.

    25.5.0release notes

Fixes and other changes 11

  • Default configuration now respects FORCE_COLOR on Windows.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • The attribute can now be set on the active renderer.

    25.5.0release notes

  • Raises a more helpful error when Rich is missing.

    25.5.0release notes

  • Respects the key argument when determining whether to overwrite the timestamp field.

    25.5.0release notes

  • No longer raises RecursionError when an exception cause chain contains itself.

    25.5.0release notes