| Name | Pinniped |
|---|---|
| Email Address | n/a |
| Posts | 2 |
-
- 2012-06-14 07:33:58
- Re: Access Logging
- Board » General Category » General Discussion
-
Thanks for your response! That wasn't exactly the issue I was having, though -- it's not an authentication issue, but a logging one, including the activity and ip addresses of anonymous users.
I never figured out how to capture the stuff that Django prints to the console by default (aside from just piping it into a file, but (a) I wanted to move away from "print" to use proper loggers instead, and (b) I didn't want to have to fuss with Apache to make that happen), but I was able to write a piece of Middleware that does what I need it to.
Very simply, I have a piece of middleware with a process_request function which grabs request.user, request.META["REMOTE_ADDR"] and request.META["PATH_INFO"], sends that information to a logger, then passes the request on. I can post my code if anyone's interested, but I don't think I've done anything particularly interesting.
-
- 2012-05-22 10:31:24
- Access Logging
- Board » General Category » General Discussion
-
I'd like to capture the GET/POST access notification that Django by default prints to the terminal. How do I go about logging those? I know that I could alternatively add logging statements to the appropriate views in my Django module, but having to add an additional line to every view seems like an ugly solution when something else is already noting the same information.
Is there any way to repurpose those print statements as log statements? Can it be done as a change to the Django project/module, without modifying Django directly?
Thank you very much.


