See: :ref:`upgrade_9.0`
- New:
- Add type definitions for the project. See #697 and #696. Special thanks to @j00bar and @MaxDude132 for the review.
- Changes:
RequestMiddleware
now relies on django signal got_request_exception instead of Middleware process_exception method. See #705, #658 and :ref:`upgrade_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.
- Other:
- 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.
- New:
- Add a :ref:`setting <settings>`
DJANGO_STRUCTLOG_USER_ID_FIELD = 'pk'
to customize what user field to use asuser_id
in the logs. See #546 and #545. Special thanks to @sshishov.
- Add a :ref:`setting <settings>`
- Changes:
- Drop support of python 3.7
- Drop support of django 3.2, and 4.1
See: :ref:`upgrade_8.0`
- New:
- add
log_kwargs
to :class:`django_structlog.signals.bind_extra_request_metadata`, :class:`django_structlog.signals.bind_extra_request_finished_metadata`, and :class:`django_structlog.signals.bind_extra_request_failed_metadata`. See #484. Special thanks to @shtoltz.
- add
- New:
- add
asgi
's async view cancellation eventrequest_cancelled
. See #413 and and :ref:`request_events`.
- add
See: :ref:`upgrade_7.0`
- New:
- (celery) add
priority
(if available) androuting_key
totask_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 :ref:`streaming_response_events`.
- (celery) add
- Changes:
- 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:
- Improved demo project
- Better UI
- Easy switch between
runserver_plus
,wsgi
anasgi
- Front-end request feedbacks using
toasts
- Fixes:
- freeze
django-ipware<6
for now due to breaking changes. See #388
- freeze
See: :ref:`upgrade_6.0`
- New:
- Python 3.12 support
- Add support of logging :ref:`commands`
task_revoked
has now asigname
metadata. See #323.task_not_found
has now atask_id
and atask
metadata. See #323.
- Fixes:
- Add missing metadata when a task is revoked. See #317. Special thanks to @badziyoussef.
- Changes:
- Drop support of python 3.7
- Drop legacy code still supporting celery < 4
4XX
status codes now log by default asWARNING
and5XX
asERROR
. The behaviour of4XX
can be customized with :ref:`configuration`. See #308. Special thanks to @adinhodovic.task_revoked
'ssignum
is now an integer instead of an object. See #323.task_not_found
'smessage
was removed and replaced bytask_id
andtask
. See #323.task_rejected
'smessage
was removed and replaced bytask_id
. See #323.- Switched from
git
'smaster
tomain
branch
- Other:
- Add new :ref:`how_tos` section in the documentation.
- New:
- django setting
DJANGO_STRUCTLOG_CELERY_ENABLED = True
replacing :class:`django_structlog.middlewares.CeleryMiddleware`. See :ref:`upgrade_6.0` and #265. Also introduce new internal app_settings that may come handy for future configurations.
- django setting
- Deprecations:
- New:
- Add new event
task_started
. See #260. Special thanks to @adrenaline681.
- Add new event
- New:
- Add new signal :class:`django_structlog.signals.update_failure_response` allowing to modify the response in case of failure. See #231. Special thanks to @HMaker.
See: :ref:`upgrade_5.0`
- Fixes:
- Rollbacks from 5.0.0:
- Rollback removal of
django_structlog.signals.bind_extra_request_failed_metadata
. Relates the above fix.
- Rollback removal of
See: :ref:`upgrade_5.0`
See: :ref:`upgrade_5.0`
- Changes:
RequestMiddleware
andCeleryMiddleware
now properly support async views
- Removed:
- (Rolled back in 5.0.2)
django_structlog.signals.bind_extra_request_failed_metadata
- (Rolled back in 5.0.2)
- Deprecates:
- New:
- Add :class:`django_structlog.middlewares.request_middleware_router` to choose automatically between Async or Sync middleware
- Rollbacks from 4.1.0:
- Rollback
RequestMiddleware
not being a class anymore, its an internalSyncRequestMiddleware
- Rollback
- Others:
- Migrate project to
pyproject.toml
instead ofsetup.py
- Add asgi server to demo project see :ref:`development`.
- Migrate project to
- New:
- Add async view support. See #180. Special thanks to @DamianMel.
- Changes:
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.
- Others:
- 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
See: :ref:`upgrade_4.0`
- Changes:
django-structlog
will now on follow LTS versions of Python, Django, and Celery. See #110. Special thanks to @jairhenrique for his convincing arguments.
- New:
- You can now install
django-structlog
withcelery
extra. Specifyingdjango-structlog[celery]==4.0.0
inrequirements.txt
will make sure yourcelery
's version is compatible.
- You can now install
- Others:
- 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:
- Others:
- Add
dependabot
to manage dependencies. See #83. Special thanks to @jairhenrique. - Upgrade various development packages
- Add
See: :ref:`upgrade_3.0`
- Changes:
django-structlog
now usesstructlog.contextvars
instead ofstructlog.threadlocal
. See the upgrade guide for more information (:ref:`upgrade_3.0`) and #78. Special thanks to @AndrewGuenther and @shimizukawa.- removed
django_structlog.processors.inject_context_dict
- minimum requirements change to
python
3.7+ - minimum requirements change to
structlog
21.5
- removed
- New:
- Add python 3.10, celery 5.2 and django 4.0 to the test matrix.
- Others:
- Remove
wrapper_class
from the configuration
- Remove
- Changes:
- Fixes:
- Implement Celery Task.throws' behaviour of logging expected exception as
INFO
with no tracebacks. See #62 and #70. Special thanks to @meunomemauricio.
- Implement Celery Task.throws' behaviour of logging expected exception as
- Fixes:
django.core.exceptions.PermissionDenied
is no longer logged as 500 but 403. See #68. Special thanks to @rabbit-aaron.
- Others:
- Add
django
3.2 andpython
3.9 to the test matrix andpypi
metadata. See #65. Special thanks to @kashewnuts.
- Add
- New:
- :class:`django_structlog.processors.inject_context_dict` for standard python loggers. See #24. Special thanks to @debfx.
- Upgrade:
- There are necessary configuration changes needed. See :ref:`upgrade_2.0` for the details.
- Changes:
- No longer add
error
anderror_traceback
. See #55 and :ref:`upgrade_2.0`. Special thanks to @debfx.
- No longer add
- Fixes:
- Fix crash when request's user is
None
for django-oauth-toolkit. See #56. Special thanks to @nicholasamorim.
- Fix crash when request's user is
- Improvements:
- Fixes:
- Fix UUID as User pk causing issues. See #52 #45 and #51. Special thanks to @fadedDexofan.
- Fixes:
- Others:
- Add
django
3.0 and 3.1 to the test matrix andpypi
supported frameworks metadata - Fix reference of the previous ci in the documentation
- Add
- Changes:
task_succeed
is nowtask_succeeded
. Special thanks to @PawelMorawian.- Remove
result
fromtask_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 bindresult
if someone really needs it.
- New:
- Improvements:
- Remove redundant
DJANGO_STRUCTLOG_LOG_USER_IN_REQUEST_FINISHED
setting and just always make sureuser_id
is inrequest_finished
andrequest_failed
instead. See #37.
- Remove redundant
- New:
- Add
DJANGO_STRUCTLOG_LOG_USER_IN_REQUEST_FINISHED
setting to support Django REST framework. See #37. Special thanks to @immortaleeb.
- Add
- New:
- Add
modify_context_before_task_publish
signal.
- Add
- Improvements:
- New:
- Bind
X-Correlation-ID
HTTP header's value ascorrelation_id
when provided in request.
- Bind
- New:
- Use
X-Request-ID
HTTP header's value asrequest_id
when provided in request. See #22. Special thanks to @jairhenrique
- Use
- New:
- Add python 3.8, celery 4.4 and django 3.0 to the test matrix.
- Improvements:
- Extract
test_app
fromdjango_structlog_demo_app
in order to testdjango_structlog
all by itself - Improve CI execution speed by merging stages
- Upgrade a few development depencencies
- Extract
- Bugfix:
- Exception logging not working properly with
DEBUG = False
. See #19. Special thanks to @danpalmer
- Exception logging not working properly with
- Improvements:
- Bugfixes:
- Improvements:
- Improve django uncaught exception formatting. See #7. Special thanks to @paulstuartparker
- Bugfixes:
- Fix
structlog
dependency not being installed
- Fix
- Improvements:
- Use black code formatter
- Improvements:
- Use appropriate packaging
- Bugfixes:
- Fix missing license file to be included in distribution
- Changes:
- In the event
task_enqueued
,task_id
andtask_name
are renamedchild_task_id
andchild_task_name
respectively to avoid override oftask_id
in nested tasks.
- In the event
- New:
- Add
task_name
when a task is enqueued
- Add
- New:
- Add support of tasks calling other tasks (introducing
parent_task_id
)
- Add support of tasks calling other tasks (introducing
- Bugfixes:
- Fix missing packages
- Improvements:
- Wheel distribution
- Improvements:
- api documentation
- code documentation
- Changes:
- Rewrite the log texts as events
- New:
- Add
celery
signalsignals.bind_extra_task_metadata
- Add
- New:
- Add
celery
tasks support
- Add
- New:
- Automated releases with tags on
travis
- Automated releases with tags on
- Bugfixes:
- Add
bind_extra_request_metadata
documentation
- Add
- Bugfixes:
- Tweaked documentation.
- New:
- Fist public release.