Update LOGGING example taken from Django docs. (#114903)

For example, Django no longer provides a custom NullHandler

6c66a41c3d

* Remove require_debug_true.
This commit is contained in:
Mariusz Felisiak 2024-02-03 08:37:21 +01:00 committed by GitHub
parent 00d7109075
commit 28bb2961ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1933,30 +1933,28 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
LOGGING = { LOGGING = {
'version': 1, 'version': 1,
'disable_existing_loggers': True, 'disable_existing_loggers': False,
'formatters': { 'formatters': {
'verbose': { 'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' 'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
'style': '{',
}, },
'simple': { 'simple': {
'format': '%(levelname)s %(message)s' 'format': '{levelname} {message}',
'style': '{',
}, },
}, },
'filters': { 'filters': {
'special': { 'special': {
'()': 'project.logging.SpecialFilter', '()': 'project.logging.SpecialFilter',
'foo': 'bar', 'foo': 'bar',
} },
}, },
'handlers': { 'handlers': {
'null': { 'console': {
'level':'DEBUG', 'level': 'INFO',
'class':'django.utils.log.NullHandler', 'class': 'logging.StreamHandler',
}, 'formatter': 'simple',
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'simple'
}, },
'mail_admins': { 'mail_admins': {
'level': 'ERROR', 'level': 'ERROR',
@ -1966,9 +1964,8 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
}, },
'loggers': { 'loggers': {
'django': { 'django': {
'handlers':['null'], 'handlers': ['console'],
'propagate': True, 'propagate': True,
'level':'INFO',
}, },
'django.request': { 'django.request': {
'handlers': ['mail_admins'], 'handlers': ['mail_admins'],