summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2014-05-30 18:04:08 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2014-05-30 18:04:08 (GMT)
commitc8f0d6ebfc8e114d72c9e642ed33ebb93276427d (patch)
tree268fa5c90cdab0b531e5a7f3de101b4f3b3fccc8 /Doc
parentfd4d0504df24e9a5849478d69db97c4d69d2e746 (diff)
parentc673a9ab87e0090cab0de60803785a6fbed46eac (diff)
downloadcpython-c8f0d6ebfc8e114d72c9e642ed33ebb93276427d.zip
cpython-c8f0d6ebfc8e114d72c9e642ed33ebb93276427d.tar.gz
cpython-c8f0d6ebfc8e114d72c9e642ed33ebb93276427d.tar.bz2
Closes #21608: Merged documentation update from 3.4.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/logging.handlers.rst19
1 files changed, 18 insertions, 1 deletions
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
index 9f3b074..8c6d24b 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -850,10 +850,27 @@ supports sending logging messages to a Web server, using either ``GET`` or
credentials, you should also specify secure=True so that your userid and
password are not passed in cleartext across the wire.
+ .. method:: mapLogRecord(record)
+
+ Provides a dictionary, based on ``record``, which is to be URL-encoded
+ and sent to the web server. The default implementation just returns
+ ``record.__dict__``. This method can be overridden if e.g. only a
+ subset of :class:`~logging.LogRecord` is to be sent to the web server, or
+ if more specific customization of what's sent to the server is required.
.. method:: emit(record)
- Sends the record to the Web server as a percent-encoded dictionary.
+ Sends the record to the Web server as an URL-encoded dictionary. The
+ :meth:`mapLogRecord` method is used to convert the record to the
+ dictionary to be sent.
+
+ .. note:: Since preparing a record for sending it to a Web server is not
+ the same as a generic formatting operation, using
+ :meth:`~logging.Handler.setFormatter` to specify a
+ :class:`~logging.Formatter` for a :class:`HTTPHandler` has no effect.
+ Instead of calling :meth:`~logging.Handler.format`, this handler calls
+ :meth:`mapLogRecord` and then :func:`urllib.parse.urlencode` to encode the
+ dictionary in a form suitable for sending to a Web server.
.. _queue-handler: