[Fixed]-Django exclude insert/select logs

1πŸ‘

βœ…

The logging configuration is in settings.py.

Here is the documentation with some examples: Django logging config – examples

In your case, you have to add something like

'loggers': {
    'django.db.backends': {
        'handlers': ['console'],
        'filters': ['SQLStatementsFilter'],
    },

This is not the full config and please check the documentation. The idea is to implement a filter that will filter all unwanted log messages only for all classes in the django.db.backends module (and submodules).

πŸ‘€Andreas Dolk

Leave a comment