diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2022-08-29 21:29:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 21:29:22 (GMT) |
commit | 6324b135acb92042017c2364540c37426b0ea65f (patch) | |
tree | 59ad1d9e4e70cf49ee99952c39d1c13719fe6cf6 /Doc/library/logging.handlers.rst | |
parent | e5b2453e61ba5376831093236d598ef5f9f1de61 (diff) | |
download | cpython-6324b135acb92042017c2364540c37426b0ea65f.zip cpython-6324b135acb92042017c2364540c37426b0ea65f.tar.gz cpython-6324b135acb92042017c2364540c37426b0ea65f.tar.bz2 |
gh-91305: Add a note about DatagramHandler and DNS latency. (GH-96380)
Diffstat (limited to 'Doc/library/logging.handlers.rst')
-rw-r--r-- | Doc/library/logging.handlers.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst index f125dfe..a012927 100644 --- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -572,6 +572,13 @@ over UDP sockets. Returns a new instance of the :class:`DatagramHandler` class intended to communicate with a remote machine whose address is given by *host* and *port*. + .. note:: As UDP is not a streaming protocol, there is no persistent connection + between an instance of this handler and *host*. For this reason, when using a + network socket, a DNS lookup might have to be made each time an event is + logged, which can introduce some latency into the system. If this affects you, + you can do a lookup yourself and initialize this handler using the looked-up IP + address rather than the hostname. + .. versionchanged:: 3.4 If ``port`` is specified as ``None``, a Unix domain socket is created using the value in ``host`` - otherwise, a UDP socket is created. |