[Django]-Django logging with user/ip

3👍

The hacky way to do this is to stick the request (or request.user) in threadlocal storage.

The correct and maintainable way is to explicitly pass the data you need into the functions that need it. If doing this seems too onerous, it may reveal a deeper problem in how you’ve structured your code.

Leave a comment