def addRemoteHandlers (logger):
    """Adds logging handlers to logger to remotely log to:

        ait.config.logging.hostname:514  (i.e. syslogd)

    If not set or hostname cannot be resolved, this method has no
    effect.
    """
    try:
        hostname = ait.config.logging.hostname

        # Do not "remote" log to this host, as that's already covered
        # by addLocalHandlers().
        if socket.getfqdn() != hostname:
            socket.getaddrinfo(hostname, None)
            logger.addHandler( SysLogHandler( (hostname,  514) ) )

    except AttributeError:
        pass  # No ait.config.logging.hostname

    except socket.gaierror:
        pass
def addRemoteHandlers ( logger ) : try : hostname = ait . config . logging . hostname if socket . getfqdn ( ) != hostname : socket . getaddrinfo ( hostname , None ) logger . addHandler ( SysLogHandler ( ( hostname , 514 ) ) ) except AttributeError : pass except socket . gaierror : pass
Adds logging handlers to logger to remotely log to:

        ait.config.logging.hostname:514  (i.e. syslogd)

    If not set or hostname cannot be resolved, this method has no
    effect.