0

我正在使用django-databtables-view应用程序,但我在控制台中收到以下错误。我在这里想念什么?

No handlers could be found for logger "django_datatables_view.mixins"

我在我的 settings.py 中包含了日志记录

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}
4

1 回答 1

1

You should add this to your handlers definition

   'null': {
        'level':'DEBUG',
        'class':'django.utils.log.NullHandler',
     }

And this to your loggers

'django_datatables_view.mixins': {
        'handlers': ['null'],
        'level': 'ERROR',
        'propagate': True,
    },

You could also set some other handler that actually logs something, check out the answer here

于 2014-04-09T20:22:50.810 回答