]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Update LOGGING example taken from Django docs. (GH-114903) (#114951)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 3 Feb 2024 15:23:33 +0000 (16:23 +0100)
committerGitHub <noreply@github.com>
Sat, 3 Feb 2024 15:23:33 +0000 (08:23 -0700)
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Doc/howto/logging-cookbook.rst

index 588f5a0a53ded0a78f4969f264c92254e216ecdf..33c57ae73473e362092f573bd122f7a85a00c1e7 100644 (file)
@@ -1933,30 +1933,28 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
 
     LOGGING = {
         'version': 1,
-        'disable_existing_loggers': True,
+        'disable_existing_loggers': False,
         'formatters': {
             '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': {
-                'format': '%(levelname)s %(message)s'
+                'format': '{levelname} {message}',
+                'style': '{',
             },
         },
         'filters': {
             'special': {
                 '()': 'project.logging.SpecialFilter',
                 'foo': 'bar',
-            }
+            },
         },
         'handlers': {
-            'null': {
-                'level':'DEBUG',
-                'class':'django.utils.log.NullHandler',
-            },
-            'console':{
-                'level':'DEBUG',
-                'class':'logging.StreamHandler',
-                'formatter': 'simple'
+            'console': {
+                'level': 'INFO',
+                'class': 'logging.StreamHandler',
+                'formatter': 'simple',
             },
             'mail_admins': {
                 'level': 'ERROR',
@@ -1966,9 +1964,8 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
         },
         'loggers': {
             'django': {
-                'handlers':['null'],
+                'handlers': ['console'],
                 'propagate': True,
-                'level':'INFO',
             },
             'django.request': {
                 'handlers': ['mail_admins'],