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 debu
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.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': "[%(asctime)s] %(levelname)s [%(name)s] %(message)s",
'datefmt': "%d/%b/%Y %H:%M:%S"
},
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'django.utils.log.NullHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'standard'
},
},
'loggers': {
'django': {
'handlers': ['console'],
'propagate': True,
'level': 'INFO',
},
'django.db.backends': {
'handlers': ['console'],
'level': 'ERROR',
'propagate': False,
},
'apps': {
'handlers': ['console'],
'level': 'DEBUG',
},
}
}
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