summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-09-24 22:30:38 +0200
committerClaude Paroz <claude@2xlibre.net>2012-09-29 22:56:18 +0200
commita014ddfef2f606471f25c756d97b3b50fcbd9e91 (patch)
tree387712a6b25cba824d7797f9214a41f374f83cea /docs
parent15202baace1453e7576806f13d137ae930de6dcb (diff)
Combined Django DEFAULT_LOGGING with user LOGGING config
Refs #18993.
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/logging.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt
index a4aae0bc02..a7f0a14b5b 100644
--- a/docs/topics/logging.txt
+++ b/docs/topics/logging.txt
@@ -192,6 +192,8 @@ There are two other logging calls available:
* ``logger.exception()``: Creates an ``ERROR`` level logging
message wrapping the current exception stack frame.
+.. _configuring-logging:
+
Configuring logging
===================
@@ -216,6 +218,14 @@ handlers, filters and formatters that you want in your logging setup,
and the log levels and other properties that you want those components
to have.
+Prior to Django 1.5, the :setting:`LOGGING` setting overwrote the :ref:`default
+Django logging configuration <default-logging-configuration>`. From Django
+1.5 forward, the project's logging configuration is merged with Django's
+defaults, hence you can decide if you want to add to, or replace the existing
+configuration. To completely override the default configuration, set the
+``disable_existing_loggers`` key to True in the :setting:`LOGGING`
+dictConfig. Alternatively you can redefine some or all of the loggers.
+
Logging is configured as soon as settings have been loaded
(either manually using :func:`~django.conf.settings.configure` or when at least
one setting is accessed). Since the loading of settings is one of the first
@@ -535,3 +545,15 @@ logging module.
'class': 'django.utils.log.AdminEmailHandler'
}
},
+
+.. _default-logging-configuration:
+
+Django's default logging configuration
+======================================
+
+By default, Django configures the ``django.request`` logger so that all messages
+with ``ERROR`` or ``CRITICAL`` level are sent to :class:`AdminEmailHandler`, as
+long as the :setting:`DEBUG` setting is set to ``False``.
+
+All messages reaching the ``django`` catch-all logger are discarded
+(sent to ``NullHandler``).