vishalanandl177 / DRF-API-Logger

An API Logger for your Django Rest Framework project.
https://github.com/vishalanandl177/DRF-API-Logger
Apache License 2.0
308 stars 56 forks source link

Can not find static files as soon as I use this package #91

Closed gijsriet closed 3 months ago

gijsriet commented 8 months ago

Hi,

I have an issue on my test server as soon as I implement drf-api-logger.

As soon as I use the package, on my test server, none of my static files can be found. When I comment out the package in installed apps everything is back to normal. None of the logs show anything useful for debugging this.

Has anyone encountered something similar or has an idea?

Django 4.2 I use a separate database for the api-logs App running on Kubernetes.

vishalanandl177 commented 8 months ago

Hi @gijsriet drf-api-logger uses some of its static files. Have you tried python manage.py collectstatic? The problem may be due to the wrong static file path configs.

If possible please share settings and logs if there is any error.

gijsriet commented 8 months ago

Hi, thanks for your answer. Yeah I know about collectstatic. The app has been running in production for over 5 years. The logs tell me nothing. Also the staticfiles are found when using findstatic, and nginx is not the isssue either. Just as soon as I add drf-api-logger, none of the static files can be found.

gijsriet commented 8 months ago

The problem is caused by this line here url_name = resolve(request.path_info).url_name in the middleware, where staticfile paths can not be resolved to a route.

vishalanandl177 commented 7 months ago

Hi @gijsriet The fixes will be available in the next release.

abe-101 commented 4 months ago

@vishalanandl177 any timeline on a release with this fix?