diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2009-10-10 20:32:36 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2009-10-10 20:32:36 (GMT) |
commit | 1c77b7f84c5fca050980854a677539ba377439dd (patch) | |
tree | 05297baa544790a3fff404e9fdb969b19e94427f /Doc | |
parent | 6e3dbbdf39f3b4eb6f18c0165e446df17218b7dc (diff) | |
download | cpython-1c77b7f84c5fca050980854a677539ba377439dd.zip cpython-1c77b7f84c5fca050980854a677539ba377439dd.tar.gz cpython-1c77b7f84c5fca050980854a677539ba377439dd.tar.bz2 |
Issue #7086: Added TCP support to SysLogHandler and tidied up some anachronisms in the code.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/logging.rst | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index ef2f34a..0614402 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -764,12 +764,12 @@ functions. Does basic configuration for the logging system by creating a :class:`StreamHandler` with a default :class:`Formatter` and adding it to the - root logger. The function does nothing if any handlers have been defined for - the root logger. The functions :func:`debug`, :func:`info`, :func:`warning`, + root logger. The functions :func:`debug`, :func:`info`, :func:`warning`, :func:`error` and :func:`critical` will call :func:`basicConfig` automatically if no handlers are defined for the root logger. - This function does nothing if the root logger already has handlers configured. + This function does nothing if the root logger already has handlers + configured for it. .. versionchanged:: 2.4 Formerly, :func:`basicConfig` did not take any keyword arguments. @@ -2008,16 +2008,22 @@ The :class:`SysLogHandler` class, located in the :mod:`logging.handlers` module, supports sending logging messages to a remote or local Unix syslog. -.. class:: SysLogHandler([address[, facility]]) +.. class:: SysLogHandler([address[, facility[, socktype]]]) Returns a new instance of the :class:`SysLogHandler` class intended to communicate with a remote Unix machine whose address is given by *address* in the form of a ``(host, port)`` tuple. If *address* is not specified, - ``('localhost', 514)`` is used. The address is used to open a UDP socket. An + ``('localhost', 514)`` is used. The address is used to open a socket. An alternative to providing a ``(host, port)`` tuple is providing an address as a string, for example "/dev/log". In this case, a Unix domain socket is used to send the message to the syslog. If *facility* is not specified, - :const:`LOG_USER` is used. + :const:`LOG_USER` is used. The type of socket opened depends on the + *socktype* argument, which defaults to :const:`socket.SOCK_DGRAM` and thus + opens a UDP socket. To open a TCP socket (for use with the newer syslog + daemons such as rsyslog), specify a value of :const:`socket.SOCK_STREAM`. + + .. versionchanged:: 2.7 + *socktype* was added. .. method:: close() |