Ticket #19395: 19395.diff

File 19395.diff, 1.6 KB (added by timo, 16 months ago)
  • docs/topics/logging.txt

    diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt
    index 15c1aa9..ed2eaca 100644
    a b use in your project code. 
    230230
    231231.. _dictConfig format: http://docs.python.org/library/logging.config.html#configuration-dictionary-schema
    232232
    233 An example
    234 ----------
     233Examples
     234--------
    235235
    236236The full documentation for `dictConfig format`_ is the best source of
    237237information about logging configuration dictionaries. However, to give
    238 you a taste of what is possible, here is an example of a fairly
    239 complex logging setup, configured using :func:`logging.config.dictConfig`::
     238you a taste of what is possible, here are a couple examples.
     239
     240First, here's a simple configuration which writes all logging to a local file::
     241
     242    LOGGING = {
     243        'version': 1,
     244        'disable_existing_loggers': False,
     245        'handlers': {
     246            'file': {
     247                'level': 'DEBUG',
     248                'class': 'logging.FileHandler',
     249                'filename': '/path/to/django/debug.log',
     250            },
     251        },
     252        'loggers': {
     253            'django.request': {
     254                'handlers': ['file'],
     255                'level': 'DEBUG',
     256                'propagate': True,
     257            },
     258        },
     259    }
     260
     261If you use this example, be sure to change the ``'filename'`` path to a
     262location that's writable by the user that's running the Django application.
     263
     264Second, here's an example of a fairly complex logging setup, configured using
     265:func:`logging.config.dictConfig`::
    240266
    241267    LOGGING = {
    242268        'version': 1,
Back to Top