diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt
index 9318dbe..e37b8bd 100644
a
|
b
|
configuration merged with Django's defaults, hence you can decide if you want to
|
219 | 219 | add to, or replace the existing configuration. |
220 | 220 | |
221 | 221 | If the ``disable_existing_loggers`` key in the :setting:`LOGGING` dictConfig is |
222 | | set to ``True`` (which is the default) the default configuration is completely |
223 | | overridden. Alternatively you can redefine some or all of the loggers by |
224 | | setting ``disable_existing_loggers`` to ``False``. |
| 222 | set to ``True`` (which is the default) then all loggers from the default |
| 223 | configuration will be disabled. Alternatively you can redefine some or all |
| 224 | of the loggers by setting ``disable_existing_loggers`` to ``False``. |
| 225 | |
| 226 | .. note:: |
| 227 | There is a catch in the way the Python Logger class is implemented: Any |
| 228 | *disabled logger* defined by the Django's default logging configuration |
| 229 | is also not propagating events to its parent. If you want to build your |
| 230 | logging configuration from scratch, then it is not enough to set |
| 231 | ``disable_existing_loggers`` to ``True``. Refer to |
| 232 | :ref:`disabling-logging-configuration` for an example. |
225 | 233 | |
226 | 234 | Logging is configured as part of the general Django ``setup()`` function. |
227 | 235 | Therefore, you can be certain that loggers are always ready for use in your |
… |
… |
use a different configuration process, you can use any other callable
|
390 | 398 | that takes a single argument. The contents of :setting:`LOGGING` will |
391 | 399 | be provided as the value of that argument when logging is configured. |
392 | 400 | |
| 401 | .. _disabling-logging-configuration: |
| 402 | |
393 | 403 | Disabling logging configuration |
394 | 404 | ------------------------------- |
395 | 405 | |
… |
… |
configuration process.
|
405 | 415 | calls, falling back to whatever default logging behavior is |
406 | 416 | defined. |
407 | 417 | |
| 418 | Here's an example how to make the logging system under Django to log |
| 419 | everything to console without having the disabled (but still existing) |
| 420 | loggers to swallow events. You may want to activate this when using the |
| 421 | ``runserver``:: |
| 422 | |
| 423 | LOGGING_CONFIG = None |
| 424 | LOGGING = { |
| 425 | 'version': 1, |
| 426 | 'handlers': { |
| 427 | 'console': { |
| 428 | 'level': os.getenv('LOGLEVEL', 'INFO'), |
| 429 | 'class': 'logging.StreamHandler', |
| 430 | 'formatter': 'debugging', |
| 431 | }, |
| 432 | }, |
| 433 | 'formatters': { |
| 434 | 'debugging': { |
| 435 | 'format': '%(name)s %(levelname)s %(module)s:%(lineno)s: %(message)s' |
| 436 | }, |
| 437 | }, |
| 438 | # A catch-all root logger. |
| 439 | 'root': { |
| 440 | 'handlers': ['console'], |
| 441 | 'level': 'DEBUG', |
| 442 | }, |
| 443 | } |
| 444 | |
| 445 | import logging.config |
| 446 | logging.config.dictConfig(LOGGING) |
| 447 | |
| 448 | By setting the ``LOGLEVEL=DEBUG`` environment variable, you'll see the |
| 449 | database queries among other stuff. |
| 450 | |
| 451 | |
408 | 452 | Django's logging extensions |
409 | 453 | =========================== |
410 | 454 | |