Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 645e458

Browse files
committed
Documented change for Issue #12168.
1 parent 9aa68e4 commit 645e458

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Doc/library/logging.handlers.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,21 @@ supports sending logging messages to a remote or local Unix syslog.
436436
The record is formatted, and then sent to the syslog server. If exception
437437
information is present, it is *not* sent to the server.
438438

439+
.. versionchanged:: 3.2.1
440+
(See: :issue:`12168`.) In earlier versions, the message sent to the
441+
syslog daemons was always terminated with a NUL byte, because early
442+
versions of these daemons expected a NUL terminated message - even
443+
though it's not in the relevant specification (RF 5424). More recent
444+
versions of these daemons don't expect the NUL byte but strip it off
445+
if it's there, and even more recent daemons (which adhere more closely
446+
to RFC 5424) pass the NUL byte on as part of the message.
447+
448+
To enable easier handling of syslog messages in the face of all these
449+
differing daemon behaviours, the appending of the NUL byte has been
450+
made configurable, through the use of a class-level attribute,
451+
``append_nul``. This defaults to ``True`` (preserving the existing
452+
behaviour) but can be set to ``False`` on a ``SysLogHandler`` instance
453+
in order for that instance to *not* append the NUL terminator.
439454

440455
.. method:: encodePriority(facility, priority)
441456

0 commit comments

Comments
 (0)