Django doesn't log much at high verbosity levels
|Reported by:||gcc||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I'd expect that Django would log something like:
- At INFO level, at least one line per request (similar to runserver output)
- At DEBUG level, enough information to recreate the request
However, it doesn't appear to:
- There are only two logger.debug statements, both logging database SQL commands
- There are no logger.info [logger.info] statements at all
- Turning on DEBUG logging for everything seems to log only SQL statements and errors
- The django.request logger only seems to be used for errors and warnings
I'd like to add more info and debug logging to django.request as stated above. Is that likely to be accepted?
Reasons for doing this:
- It's hard to interpret the Django logs if they don't contain a record of each request. E.g. you have an error message in the logs. Which request caused it?
- It's hard to tell that logging is configured properly if, at DEBUG level, only SQL queries are showing up. This is not expected behaviour.
- As @russellm says, Apache can be configured to log full request details including POST data (although how is a mystery to me). But not everyone uses Apache. I'm not sure that Nginx and Lighttpd can be configured thus.
- I would hope that the impact is minimal to zero if logging is set to INFO or higher.
Change History (8)
comment:1 Changed 15 months ago by anonymous
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset