@@ -613,7 +613,7 @@ The :class:`SysLogHandler` class, located in the :mod:`logging.handlers` module,
613613supports sending logging messages to a remote or local Unix syslog.
614614
615615
616- .. class :: SysLogHandler(address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=socket.SOCK_DGRAM)
616+ .. class :: SysLogHandler(address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=socket.SOCK_DGRAM, timeout=None )
617617
618618 Returns a new instance of the :class: `SysLogHandler ` class intended to
619619 communicate with a remote Unix machine whose address is given by *address * in
@@ -626,6 +626,11 @@ supports sending logging messages to a remote or local Unix syslog.
626626 *socktype * argument, which defaults to :const: `socket.SOCK_DGRAM ` and thus
627627 opens a UDP socket. To open a TCP socket (for use with the newer syslog
628628 daemons such as rsyslog), specify a value of :const: `socket.SOCK_STREAM `.
629+ If *timeout * is specified, it sets a timeout (in seconds) for the socket operations.
630+ This can help prevent the program from hanging indefinitely if the syslog server is
631+ unreachable. By default, *timeout * is ``None ``, meaning no timeout is applied.
632+
633+
629634
630635 Note that if your server is not listening on UDP port 514,
631636 :class: `SysLogHandler ` may appear not to work. In that case, check what
@@ -645,6 +650,8 @@ supports sending logging messages to a remote or local Unix syslog.
645650 .. versionchanged :: 3.2
646651 *socktype * was added.
647652
653+ .. versionchanged :: 3.14
654+ *timeout * was added.
648655
649656 .. method :: close()
650657
0 commit comments