Fixed #14388 -- Corrected some typos in the logging docs. Thanks to varikin, gremmie, Ramiro Morales and Gabriel Hurley for the reviews.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13982 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2010-10-05 00:11:41 +00:00
parent 24acca4139
commit 240f68e4e5
2 changed files with 20 additions and 16 deletions

View File

@ -1006,11 +1006,13 @@ Default: ``()`` (Empty tuple)
A tuple of directories where Django looks for translation files. A tuple of directories where Django looks for translation files.
See :ref:`using-translations-in-your-own-projects`. See :ref:`using-translations-in-your-own-projects`.
.. setting:: LOGIN_REDIRECT_URL .. setting:: LOGGING
LOGGING LOGGING
------- -------
.. versionadded:: 1.3
Default: A logging configuration dictionary. Default: A logging configuration dictionary.
A data structure containing configuration information. The contents of A data structure containing configuration information. The contents of
@ -1020,11 +1022,13 @@ configuration method described in :setting:`LOGGING_CONFIG`.
The default logging configuration passes HTTP 500 server errors to an The default logging configuration passes HTTP 500 server errors to an
email log handler; all other log messages are given to a NullHandler. email log handler; all other log messages are given to a NullHandler.
.. versionadded:: 1.3 .. setting:: LOGGING_CONFIG
LOGGING_CONFIG LOGGING_CONFIG
-------------- --------------
.. versionadded:: 1.3
Default: ``'django.utils.log.dictConfig'`` Default: ``'django.utils.log.dictConfig'``
A path to a callable that will be used to configure logging in the A path to a callable that will be used to configure logging in the
@ -1036,7 +1040,7 @@ configuration process will be skipped.
.. _dictConfig: http://docs.python.org/library/logging.html#logging.dictConfig .. _dictConfig: http://docs.python.org/library/logging.html#logging.dictConfig
.. versionadded:: 1.3 .. setting:: LOGIN_REDIRECT_URL
LOGIN_REDIRECT_URL LOGIN_REDIRECT_URL
------------------ ------------------

View File

@ -35,7 +35,7 @@ Loggers
A logger is the entry point into the logging system. Each logger is A logger is the entry point into the logging system. Each logger is
a named bucket to which messages can be written for processing. a named bucket to which messages can be written for processing.
A logger is configured to have *log level*. This log level describes A logger is configured to have a *log level*. This log level describes
the severity of the messages that the logger will handle. Python the severity of the messages that the logger will handle. Python
defines the following log levels: defines the following log levels:
@ -59,7 +59,7 @@ the event that is being logged. This can include details such as a
stack trace or an error code. stack trace or an error code.
When a message is given to the logger, the log level of the message is When a message is given to the logger, the log level of the message is
compare to the log level of the logger. If the log level of the compared to the log level of the logger. If the log level of the
message meets or exceeds the log level of the logger itself, the message meets or exceeds the log level of the logger itself, the
message will undergo further processing. If it doesn't, the message message will undergo further processing. If it doesn't, the message
will be ignored. will be ignored.
@ -84,7 +84,7 @@ A logger can have multiple handlers, and each handler can have a
different log level. In this way, it is possible to provide different different log level. In this way, it is possible to provide different
forms of notification depending on the importance of a message. For forms of notification depending on the importance of a message. For
example, you could install one handler that forwards ``ERROR`` and example, you could install one handler that forwards ``ERROR`` and
``CRITICIAL`` messages to a paging service, while a second handler ``CRITICAL`` messages to a paging service, while a second handler
logs all messages (including ``ERROR`` and ``CRITICAL`` messages) to a logs all messages (including ``ERROR`` and ``CRITICAL`` messages) to a
file for later analysis. file for later analysis.
@ -143,7 +143,7 @@ And that's it! Every time the ``bad_mojo`` condition is activated, an
error log record will be written. error log record will be written.
Naming loggers Naming loggers
~~~~~~~~~~~~~~ --------------
The call to :meth:`logging.getLogger()` obtains (creating, if The call to :meth:`logging.getLogger()` obtains (creating, if
necessary) an instance of a logger. The logger instance is identified necessary) an instance of a logger. The logger instance is identified
@ -177,7 +177,7 @@ you don't want a particular logger to propagate to it's parents, you
can turn off this behavior. can turn off this behavior.
Making logging calls Making logging calls
~~~~~~~~~~~~~~~~~~~~ --------------------
The logger instance contains an entry method for each of the default The logger instance contains an entry method for each of the default
log levels: log levels:
@ -190,10 +190,10 @@ log levels:
There are two other logging calls available: There are two other logging calls available:
* ``logger.log()``: manually a logging message with a specific * ``logger.log()``: Manually emits a logging message with a
log level. specific log level.
* ``logger.exception()``: create a ``ERRORR`` level logging * ``logger.exception()``: Creates an ``ERORR`` level logging
message wrapping the current exception stack frame. message wrapping the current exception stack frame.
Configuring logging Configuring logging
@ -204,7 +204,7 @@ You also need to configure the loggers, handlers, filters and
formatters to ensure that logging output is output in a useful way. formatters to ensure that logging output is output in a useful way.
Python's logging library provides several techniques to configure Python's logging library provides several techniques to configure
logging, ranging from a programatic interface to configuration files. logging, ranging from a programmatic interface to configuration files.
By default, Django uses the `dictConfig format`_. By default, Django uses the `dictConfig format`_.
.. note:: .. note::
@ -320,15 +320,15 @@ This logging configuration does the following things:
* Defines three handlers: * Defines three handlers:
* ``null``, a NullHandler, which will pass any `DEBUG` or * ``null``, a NullHandler, which will pass any ``DEBUG`` or
higher message to ``/dev/null``. higher message to ``/dev/null``.
* ``console``, a StreamHandler, which will print any `DEBUG` * ``console``, a StreamHandler, which will print any ``DEBUG``
message to stdout. This handler uses the `simple` output message to stdout. This handler uses the `simple` output
format. format.
* ``mail_admins``, an AdminEmailHandler, which will email any * ``mail_admins``, an AdminEmailHandler, which will email any
`ERROR` level message to the site admins. This handler uses ``ERROR`` level message to the site admins. This handler uses
the ``special`` filter. the ``special`` filter.
* Configures three loggers: * Configures three loggers:
@ -346,7 +346,7 @@ This logging configuration does the following things:
or higher that also pass the ``special`` filter to two or higher that also pass the ``special`` filter to two
handlers -- the ``console``, and ``mail_admins``. This handlers -- the ``console``, and ``mail_admins``. This
means that all ``INFO`` level messages (or higher) will be means that all ``INFO`` level messages (or higher) will be
printed to the console; ``ERROR`` and ``CRITICIAL`` printed to the console; ``ERROR`` and ``CRITICAL``
messages will also be output via e-mail. messages will also be output via e-mail.
.. _formatter documentation: http://docs.python.org/library/logging.html#formatter-objects .. _formatter documentation: http://docs.python.org/library/logging.html#formatter-objects