diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt index ca23609cee..d1aa8a3ea9 100644 --- a/docs/topics/logging.txt +++ b/docs/topics/logging.txt @@ -242,6 +242,9 @@ However, to give you a taste of what is possible, here are several examples. First, here's a simple configuration which writes all logging from the :ref:`django-logger` logger to a local file:: + .. code-block:: python + :caption: settings.py + LOGGING = { 'version': 1, 'disable_existing_loggers': False, @@ -274,6 +277,9 @@ messages. With this config, however, you can also set the environment variable ``DJANGO_LOG_LEVEL=DEBUG`` to see all of Django's debug logging which is very verbose as it includes all database queries:: + .. code-block:: python + :caption: settings.py + import os LOGGING = { @@ -294,6 +300,9 @@ verbose as it includes all database queries:: Finally, here's an example of a fairly complex logging setup:: + .. code-block:: python + :caption: settings.py + LOGGING = { 'version': 1, 'disable_existing_loggers': False,