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

User Details to Logs #71

Closed mallucodewizard closed 1 year ago

mallucodewizard commented 1 year ago

Is there any way to add user details to the logs for eg: username or user id.

vishalanandl177 commented 1 year ago

As of now, it's not supported here, but I'll suggest you override the api_logger_middleware middleware or use signals to add more custom info before storing anywhere.

Let me know if you need help regarding this.

mallucodewizard commented 1 year ago

yea

As of now, it's not supported here, but I'll suggest you override the api_logger_middleware middleware or use signals to add more custom info before storing anywhere.

Let me know if you need help regarding this.

yea i think overriding middleware might help but using signals wont because the kwargs doesnt contain the request object. if you could provide the request object in kwargs in next update it will be really helpful

vishalanandl177 commented 1 year ago

Sure, I'll update this soon.

vishalanandl177 commented 1 year ago

Closing due to inactivity.