NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2131 most downloaded on PyPI
Structured Logging for Django
Last release 4 months ago
30 May 2026
Release timing varies
gaps range from 8 days to 7 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
75 releases · first in 2019
New: - Add settings to configure the logging levels for the request middleware and celery task events. See #1022 .
Add settings to configure the logging levels for the request middleware and celery task events. See #1022 .
New: - Add 5xx and cancelled request log level config. See #935 . Special thanks to @fcortes .
Add 5xx and cancelled request log level config. See #935 . Special thanks to @fcortes .
Add python 3.14 support. See #937 .
Drop python 3.9 support.
One column per quarter.
Fixes: - fix duration_ms to the celery tasks metadata not working. See #811 . Special thanks to @ahumeau .
fix duration_ms to the celery tasks metadata not working. See #811 . Special thanks to @ahumeau .
fix type in setting documentation
fix type in setting documentation
new setting DJANGO_STRUCTLOG_IP_LOGGING_ENABLED (default True ) to allow to disable ip binding. See #803 . Special thanks to @dulguunpc .
add duration_ms to the celery tasks metadata. See #796 . Special thanks to @ahumeau .
vary: Cookie was always set. See #734 . Special thanks to @last-partizan
add support of django 5.2 (just adding it to the test matrix, no code changes)
Fixes: - Fix exceptions not being propagated when using streaming response. See #747 . Special thanks to @liambuchanan .
Fix exceptions not being propagated when using streaming response. See #747 . Special thanks to @liambuchanan .
setup trusted publishing
setup trusted publishing
See: Upgrading to 9.0+ New: - Add type definitions for the project. See #697 and #696 . Special thanks to @j00bar and @MaxDude132 for the review.
Add type definitions for the project. See #697 and #696 . Special thanks to @j00bar and @MaxDude132 for the review.
RequestMiddleware now relies on django signal got_request_exception instead of Middleware process_exception method. See #705 , #658 and Upgrading to 9.0+ . Special thanks to @sshishov .
Add python 3.13 support. See #674 .
Drop python 3.8 support. See #674 .
Django 5.1 and celery 5.4 support. See #617 .
Migrated project to use python 3.13 along with readthedocs generation.
now use isort
fixed codecov github action that was not properly configured and therefore not properly reporting coverage.
Nothing published for this version
Nothing published for this version
New: - Add a setting DJANGO_STRUCTLOG_USER_ID_FIELD = 'pk' to customize what user field to use as user_id in the logs. See #546 and #545 . Special tha
Add a setting DJANGO_STRUCTLOG_USER_ID_FIELD = 'pk' to customize what user field to use as user_id in the logs. See #546 and #545 . Special thanks to @sshishov .
Drop support of python 3.7
Drop support of django 3.2, and 4.1
See: Upgrading to 8.0+ New: - add log_kwargs to django_structlog.signals.bind_extra_request_metadata , django_structlog.signals.bind_extra_request_fin
add log_kwargs to django_structlog.signals.bind_extra_request_metadata , django_structlog.signals.bind_extra_request_finished_metadata , and django_structlog.signals.bind_extra_request_failed_metadata . See #484 . Special thanks to @shtoltz .
New: - add asgi ’s async view cancellation event request_cancelled . See #413 and and Request Events .
add asgi ’s async view cancellation event request_cancelled . See #413 and and Request Events .
See: Upgrading to 7.0+ New: - (celery) add priority (if available) and routing_key to task_enqueued . See #345 and #341 . Special thanks to badziyouss
(celery) add priority (if available) and routing_key to task_enqueued . See #345 and #341 . Special thanks to badziyoussef .
Django 5.0 support. See #350 . Take note async view cancellation when using asgi does not work yet, see #351 .
Add streaming response support (for both sync and async) and Django 5’s async cancellation. See #353 and StreamingHttpResponse Events .
Supports django-ipware 6+ only. See #403 . Special thanks to the maintainer @un33k .
Drop support of django 4.0. See #338 . Special thanks to @jairhenrique .
Other:
Better UI
Easy switch between runserver_plus , wsgi an asgi
Front-end request feedbacks using toasts
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixes: - freeze django-ipware<6 for now due to breaking changes. See #388
freeze django-ipware<6 for now due to breaking changes. See #388
freeze django-ipware<6 for now due to breaking changes. See #388
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Deprecations: - django_structlog.middlewares.CeleryMiddleware (see above).
django setting DJANGO_STRUCTLOG_CELERY_ENABLED = True replacing django_structlog.middlewares.CeleryMiddleware . See Upgrading to 6.0+ and #265 . Also introduce new internal app_settings that may come handy for future configurations.
django_structlog.middlewares.CeleryMiddleware (see above).
New: - Add new event task_started . See #260 . Special thanks to @adrenaline681 .
Add new event task_started . See #260 . Special thanks to @adrenaline681 .
New: - Add new signal django_structlog.signals.update_failure_response allowing to modify the response in case of failure. See #231 . Special thanks t
Add new signal django_structlog.signals.update_failure_response allowing to modify the response in case of failure. See #231 . Special thanks to @HMaker .
See: Upgrading to 5.0+ Fixes: - Fix regression in 5.0.0 and 5.0.1 where exceptions were not logged as error but as info . See #226 . Special thanks to
Fix regression in 5.0.0 and 5.0.1 where exceptions were not logged as error but as info . See #226 . Special thanks to @ntap-fge .
Rollback removal of django_structlog.signals.bind_extra_request_failed_metadata . Relates the above fix.
See: Upgrading to 5.0+ Changes: - minimum requirements change for asgiref to 3.6.0. See #209 . Special thanks to @adinsoon .
minimum requirements change for asgiref to 3.6.0. See #209 . Special thanks to @adinsoon .
Deprecates: - django_structlog.middlewares.request_middleware_router
RequestMiddleware and CeleryMiddleware now properly support async views
(Rolled back in 5.0.2) django_structlog.signals.bind_extra_request_failed_metadata
django_structlog.middlewares.request_middleware_router
django_structlog.middlewares.requests.AsyncRequestMiddleware
django_structlog.middlewares.requests.SyncRequestMiddleware
New: - Add django_structlog.middlewares.request_middleware_router to choose automatically between Async or Sync middleware
Add django_structlog.middlewares.request_middleware_router to choose automatically between Async or Sync middleware
Rollback RequestMiddleware not being a class anymore, its an internal SyncRequestMiddleware
Migrate project to pyproject.toml instead of setup.py
Add asgi server to demo project see Development .
New: - Add async view support. See #180 . Special thanks to @DamianMel .
Add async view support. See #180 . Special thanks to @DamianMel .
RequestMiddleware is no longer a class but a function due to async view support. This should only affect projects using the middleware not as intended. If this cause you problems, please refer to this issue #183 , the documentation or feel free to open a new issue. Special thanks to @gvangool for pointing that out.
Add colours in log in the demo project. See 63bdb4d to update your projects. Special thanks to @RoscoeTheDog .
Upgrade or remove various development packages
New: - Add support to python 3.11. See #142 . Special thanks to @jairhenrique .
Add support to python 3.11. See #142 . Special thanks to @jairhenrique .
See: Upgrading to 4.0+ Changes: - django-structlog will now on follow LTS versions of Python, Django, and Celery. See #110 . Special thanks to @jairhe
django-structlog will now on follow LTS versions of Python, Django, and Celery. See #110 . Special thanks to @jairhenrique for his convincing arguments.
You can now install django-structlog with celery extra. Specifying django-structlog[celery]==4.0.0 in requirements.txt will make sure your celery ’s version is compatible.
Upgrade or remove various development packages
Upgrade local development environment from python 3.7 to 3.10 and from django 3.2 to django 4.1
Added a gh-pages
Fixes: - AttributeError with custom User without pk . See #80 . Special thanks to @mlegner .
AttributeError with custom User without pk . See #80 . Special thanks to @mlegner .
Add dependabot to manage dependencies. See #83 . Special thanks to @jairhenrique .
Upgrade various development packages
See: Upgrading to 3.0+ Changes:
See: Upgrading to 3.0+ Changes:
removed django_structlog.processors.inject_context_dict
minimum requirements change to python 3.7+
minimum requirements change to structlog 21.5
Add python 3.10, celery 5.2 and django 4.0 to the test matrix.
Remove wrapper_class from the configuration
Changes: - Requests were logged as (as an object) and now they are logged like this GET / (as a string). See #72 . Special thanks to @humitos .
Requests were logged as <WSGIRequest: GET '/'> (as an object) and now they are logged like this GET / (as a string). See #72 . Special thanks to @humitos .
Fixes: - Implement Celery Task.throws ’ behaviour of logging expected exception as INFO with no tracebacks. See #62 and #70 . Special thanks to @meuno
Implement Celery Task.throws ’ behaviour of logging expected exception as INFO with no tracebacks. See #62 and #70 . Special thanks to @meunomemauricio .
Fixes: - django.core.exceptions.PermissionDenied is no longer logged as 500 but 403. See #68 . Special thanks to @rabbit-aaron .
django.core.exceptions.PermissionDenied is no longer logged as 500 but 403. See #68 . Special thanks to @rabbit-aaron .
Others: - Add django 3.2 and python 3.9 to the test matrix and pypi metadata. See #65 . Special thanks to @kashewnuts .
Add django 3.2 and python 3.9 to the test matrix and pypi metadata. See #65 . Special thanks to @kashewnuts .
New: - django_structlog.processors.inject_context_dict for standard python loggers. See #24 . Special thanks to @debfx .
django_structlog.processors.inject_context_dict for standard python loggers. See #24 . Special thanks to @debfx .
Upgrade: - There are necessary configuration changes needed. See Upgrading to 2.0+ for the details.
There are necessary configuration changes needed. See Upgrading to 2.0+ for the details.
No longer add error and error_traceback . See #55 and Upgrading to 2.0+ . Special thanks to @debfx .
Fix crash when request’s user is None for django-oauth-toolkit . See #56 . Special thanks to @nicholasamorim .
There are necessary configuration changes needed. See upgrade_2.0 for the details.
Fix crash when request's user is None for django-oauth-toolkit. See #56. Special thanks to @nicholasamorim.
Improvements: - Call stack of exception in log is now an appropriate string. See #54 . Special thanks to @debfx .
Call stack of exception in log is now an appropriate string. See #54 . Special thanks to @debfx .
Fixes: - Fix UUID as User pk causing issues. See #52 #45 and #51 . Special thanks to @fadedDexofan .
Fix UUID as User pk causing issues. See #52 #45 and #51 . Special thanks to @fadedDexofan .
Fixes: - Removed providing_args from signals to fix django 4.0 deprecation warnings introduced by django 3.1. See #44 . Special thanks to @ticosax .
Removed providing_args from signals to fix django 4.0 deprecation warnings introduced by django 3.1. See #44 . Special thanks to @ticosax .
Fix sender of signals.pre_task_succeeded
Documented signal parameters in doc strings and API documentation to replace providing_args
Add django 3.0 and 3.1 to the test matrix and pypi supported frameworks metadata
Fix reference of the previous ci in the documentation
Changes: - task_succeed is now task_succeeded . Special thanks to @PawelMorawian .
task_succeed is now task_succeeded . Special thanks to @PawelMorawian .
Remove result from task_succeeded log (may be added back, see below). Special thanks to @PawelMorawian as well.
Add django_structlog.celery.signals.pre_task_succeeded . To be able to bind result if someone really needs it.
New: - Add bind_extra_request_finished_metadata and bind_extra_request_failed_metadata . See #39 . Special thanks to @prik2693 .
Add bind_extra_request_finished_metadata and bind_extra_request_failed_metadata . See #39 . Special thanks to @prik2693 .
Improvements: - Remove redundant DJANGO_STRUCTLOG_LOG_USER_IN_REQUEST_FINISHED setting and just always make sure user_id is in request_finished and re
Remove redundant DJANGO_STRUCTLOG_LOG_USER_IN_REQUEST_FINISHED setting and just always make sure user_id is in request_finished and request_failed instead. See #37 .
New: - Add DJANGO_STRUCTLOG_LOG_USER_IN_REQUEST_FINISHED setting to support Django REST framework . See #37 . Special thanks to @immortaleeb .
Add DJANGO_STRUCTLOG_LOG_USER_IN_REQUEST_FINISHED setting to support Django REST framework . See #37 . Special thanks to @immortaleeb .
New: - Add modify_context_before_task_publish signal.
Add modify_context_before_task_publish signal.
Improvements: - Allow to override celery task metadata from binding. See #32 and #33 . Special thanks to @chiragjn
Allow to override celery task metadata from binding. See #32 and #33 . Special thanks to @chiragjn
Improvements: - Add support for celery 3. See #26 and #31 . Special thanks to @chiragjn and @prik2693
Add support for celery 3. See #26 and #31 . Special thanks to @chiragjn and @prik2693
New: - Bind X-Correlation-ID HTTP header’s value as correlation_id when provided in request.
Bind X-Correlation-ID HTTP header’s value as correlation_id when provided in request.
New: - Use X-Request-ID HTTP header’s value as request_id when provided in request. See #22 . Special thanks to @jairhenrique
Use X-Request-ID HTTP header’s value as request_id when provided in request. See #22 . Special thanks to @jairhenrique
New: - Add python 3.8, celery 4.4 and django 3.0 to the test matrix.
Add python 3.8, celery 4.4 and django 3.0 to the test matrix.
Extract test_app from django_structlog_demo_app in order to test django_structlog all by itself
Improve CI execution speed by merging stages
Upgrade a few development depencencies
Bugfix: - Exception logging not working properly with DEBUG = False . See #19 . Special thanks to @danpalmer
Exception logging not working properly with DEBUG = False . See #19 . Special thanks to @danpalmer
Bugfix: - Fix support of different primary key for User model. See #13 . Special thanks to @dhararon
Fix support of different primary key for User model. See #13 . Special thanks to @dhararon
Improvements: - Add support of projects without AuthenticationMiddleware . See #9 . Special thanks to @dhararon
Add support of projects without AuthenticationMiddleware . See #9 . Special thanks to @dhararon
Bugfixes: - Remove extraneous rest-framework dependency introduced by #7 . See #8 . Special thanks to @ghickman
Remove extraneous rest-framework dependency introduced by #7 . See #8 . Special thanks to @ghickman
Improvements: - Improve django uncaught exception formatting. See #7 . Special thanks to @paulstuartparker
Improve django uncaught exception formatting. See #7 . Special thanks to @paulstuartparker
Bugfixes: - Fix structlog dependency not being installed
Fix structlog dependency not being installed
Use black code formatter
Improvements: - Use appropriate packaging
Use appropriate packaging
Your coding agent can read these notes before it upgrades. Set up the MCP server →