How to use the daiquiri.handlers.SyslogHandler function in daiquiri

To help you get started, we’ve selected a few daiquiri examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jd / daiquiri / daiquiri / output.py View on Github external
def __init__(self, program_name=None, facility="user",
                 formatter=formatter.TEXT_FORMATTER, level=None):
        if syslog is None:
            # FIXME(jd) raise something more specific
            raise RuntimeError("syslog is not available on this platform")
        super(Syslog, self).__init__(
            handlers.SyslogHandler(
                program_name=program_name or get_program_name(),
                facility=self._find_facility(facility)),
            formatter, level)
github jd / daiquiri / daiquiri / handlers.py View on Github external
def __init__(self, program_name, facility=None):
        # Default values always get evaluated, for which reason we avoid
        # using 'syslog' directly, which may not be available.
        facility = facility if facility is not None else syslog.LOG_USER
        if not syslog:
            raise RuntimeError("Syslog not available on this platform")
        super(SyslogHandler, self).__init__()
        syslog.openlog(program_name, 0, facility)