Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28bb296

Browse files
authored
Update LOGGING example taken from Django docs. (#114903)
For example, Django no longer provides a custom NullHandler django/django@6c66a41 * Remove require_debug_true.
1 parent 00d7109 commit 28bb296

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

Doc/howto/logging-cookbook.rst

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,30 +1933,28 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
19331933

19341934
LOGGING = {
19351935
'version': 1,
1936-
'disable_existing_loggers': True,
1936+
'disable_existing_loggers': False,
19371937
'formatters': {
19381938
'verbose': {
1939-
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
1939+
'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
1940+
'style': '{',
19401941
},
19411942
'simple': {
1942-
'format': '%(levelname)s %(message)s'
1943+
'format': '{levelname} {message}',
1944+
'style': '{',
19431945
},
19441946
},
19451947
'filters': {
19461948
'special': {
19471949
'()': 'project.logging.SpecialFilter',
19481950
'foo': 'bar',
1949-
}
1951+
},
19501952
},
19511953
'handlers': {
1952-
'null': {
1953-
'level':'DEBUG',
1954-
'class':'django.utils.log.NullHandler',
1955-
},
1956-
'console':{
1957-
'level':'DEBUG',
1958-
'class':'logging.StreamHandler',
1959-
'formatter': 'simple'
1954+
'console': {
1955+
'level': 'INFO',
1956+
'class': 'logging.StreamHandler',
1957+
'formatter': 'simple',
19601958
},
19611959
'mail_admins': {
19621960
'level': 'ERROR',
@@ -1966,9 +1964,8 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
19661964
},
19671965
'loggers': {
19681966
'django': {
1969-
'handlers':['null'],
1967+
'handlers': ['console'],
19701968
'propagate': True,
1971-
'level':'INFO',
19721969
},
19731970
'django.request': {
19741971
'handlers': ['mail_admins'],

0 commit comments

Comments
 (0)