authentication - Log access by users in Django? -
I currently have HTTP logs that show me which page has accessed, but it does not include a username is. What would be the easiest way to remove that information? A middle class?
There is a way to do this:
class requestlogging modelware (object ): Def process_response (auto, request, response): if request.user and request.user.is_anonymous () No: # log message here Return feedback
Other options use centralized logging tool To do that is easy to setup and it provides a very good logging user interface. Log messages are filled with versatile information, which includes users associated with the request.
Comments
Post a Comment