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 initstructlog 2612 changes
Breaking changes 1
Support for Python 3.8 and 3.9 was removed.
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.
New APIs and options 5
Adds a name attribute, allowing use with the structlog.stdlib.add_logger_name() processor without the standard library integration.
Adds Rich-based monochrome exception rendering, supported throughout ConsoleRenderer when the user asks for no colors.
Adds the qualified import name of the callsite module, or __main__ for the entry point; this is available only for structlog-originated events.
Adds the snake_case alias get_effective_level() for getEffectiveLevel(), improving compatibility with FilteringBoundLogger and allowing configurations to be swapped without changing call sites.
Adds the snake_case alias is_enabled_for() for isEnabledFor(), improving compatibility with FilteringBoundLogger and allowing configurations to be swapped without changing call sites.
Behavior and default changes 1
No longer warns when the exception key has a rendered value despite a fancy formatter being configured.
Fixes and other changes 4
Python 3.15 support was added.
These loggers now hold weak references to output files, preventing file leakage in long-running processes that open many logfiles.
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.
WriteLogger is usable after unpickling.
structlog 2523 changes
Breaking changes 1
Renamed the pad_event argument to pad_event_to to distinguish it from the boolean pad_level argument.
Deprecations 1
The pad_event argument is deprecated; use pad_event_to to distinguish it from the boolean pad_level argument.
New APIs and options 10
Native loggers now accept a dictionary for dictionary-based interpolation.
The attribute can now be set on the active renderer.
The attribute can now be set, allowing developers to change exception formatting, including disabling pretty-printing.
Added get_active() to retrieve the currently active ConsoleRenderer instance.
Added a method to reuse the default column styles.
The attribute can now be set on the active renderer.
Exposes Rich's upstream code_width parameter.
On Python 3.11+, QUAL_NAME adds the qualified name of a structlog-originated callsite, including scope and class names.
LoggerFactory now supports the stacklevel parameter.
capture_logs() optionally accepts processors to apply before capture.
Fixes and other changes 11
Default configuration now respects FORCE_COLOR on Windows.
The attribute can now be set on the active renderer.
The attribute can now be set on the active renderer.
The attribute can now be set on the active renderer.
The attribute can now be set on the active renderer.
The attribute can now be set on the active renderer.
The attribute can now be set on the active renderer.
The attribute can now be set on the active renderer.
Raises a more helpful error when Rich is missing.
Respects the key argument when determining whether to overwrite the timestamp field.
No longer raises RecursionError when an exception cause chain contains itself.