How do I run django in debug=True without being bombarded by the sql logging?
Being forced to squint through all this noise is making it rather hard to see my debug messages....
[Thu Jul 28 19:56:27 2011] [error] DEBUG:(0.000) SELECT `django_session`.`session_key`, `django_session`.`session_data`, `django_session`.`expire_date` FROM `django_session` WHERE (`django_session`.`session_key` = foobar AND `django_session`.`expire_date` > 2011-07-28 19:56:27 ); args=('foobar', u'2011-07-28 19:56:27')
[Thu Jul 28 19:56:27 2011] [error] DEBUG:(0.000) SELECT `Users`.`id`, `Users`.`auth_id`, `Users`.`username`, `Users`.`pwhash`, `Users`.`first_name`, `Users`.`last_name`, `Users`.`email`, `Users`.`notes`, `Users`.`force_password_change`, `Users`.`deleted`, `Users`.`deleted_username` FROM `Users` WHERE (`Users`.`deleted` = False AND `Users`.`id` = 2 ); args=(False, 2)
[Thu Jul 28 19:56:27 2011] [error] DEBUG:(0.000) SELECT `Auths`.`id`, `Auths`.`developer_id`, `Auths`.`application_id` FROM `Auths` WHERE `Auths`.`id` = 2 ; args=(2,)
[Thu Jul 28 19:56:27 2011] [error] DEBUG:(0.000) SELECT `Auths`.`id`, `Auths`.`developer_id`, `Auths`.`application_id` FROM `Auths` WHERE `Auths`.`id` = 2 ; args=(2,)
In Django 1.3 this can be done rather simply with the inclusion of logging. In summary the way I do it is very similar to the docs and keep the focus of logging on my application. My settings.py file currently looks like this.
If you are using an older version of Django you can setup logging by using filters (Yes you can do this in 1.3 too.) This SO post should provide you with what you need to get going.
Edit Update
Again following the documentation which gives an example combined with this post should get you where you need to go.
django
handler and propagate it down the chain..django.db.backends
which doesn't propagate but raise the noise floor to ERRORI don't think there is anything else?
HTH