dabapps / django-log-request-id

Django middleware and log filter to attach a unique ID to every log message generated as part of a request
BSD 2-Clause "Simplified" License
371 stars 64 forks source link

Does it support new-style middleware? #23

Closed zivSher closed 4 years ago

zivSher commented 6 years ago

Hi, I noticed that the package uses MIDDLEWARE_CLASSES, which is the old style middleware. Does it support also new style? Thanks.

Checkroth commented 6 years ago

I'm not the maintainer, but I just went through adding tests for py36 and django 1.11.

I assume you're talking about Django 2.0 middleware. I can tell you that the build for this project will fail for Django 2.0, and the library itself probably won't work with django 2.0 either.

You could always try adding it to a 2.0 project and paste the results here, but I wouldn't recommend using it for a version of django that it doesn't explicitly support.

pzelnip commented 6 years ago

I don't think the reporter was referring to Django 2.0. Middleware changed in Django 1.10, see https://docs.djangoproject.com/en/1.10/topics/http/middleware/ which reads:

Changed in Django 1.10: A new style of middleware was introduced for use with the new MIDDLEWARE setting. If you’re using the old MIDDLEWARE_CLASSES setting, you’ll need to adapt old, custom middleware before using the new setting. This document describes new-style middleware. Refer to this page in older versions of the documentation for a description of how old-style middleware works.

I'm not sure what the issue is though as I've successfully used django-log-request-id (1.3.2) on a Django 1.11.5 project without modification.

sshishov commented 6 years ago

It will work as expected prion 1.10, with 1.10 and later including Django 2.0 and later. Using this package in all projects. working like a charm

This issue can be closed as 1.3.2 version is working with new MIDDLEWARE settings and also Django 2.0 and later!

RealOrangeOne commented 4 years ago

This issue can be closed as 1.3.2 version is working with new MIDDLEWARE settings and also Django 2.0 and later!

Correct!