Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

syslog-rfc5424-formatter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syslog-rfc5424-formatter

Logging formatter which produces well-formatted RFC5424 Syslog Protocol messages

  • 1.2.3
  • PyPI
  • Socket score

Maintainers
1

This module implements a python logging formatter which produces well-formed RFC5424-compatible Syslog messages to a given socket.

CI PyPI version Documentation Status

Usage

If you're configuring your loggers from code, you should use this formatter as below:

import logging
import logging.handlers
from syslog_rfc5424_formatter import RFC5424Formatter


def set_up_logging():
    h = logging.handlers.SysLogHandler('/path/to/syslog_socket')
    h.setFormatter(RFC5424Formatter())
    logging.getLogger('').addHandler(h)

If you're using a more modern combination of a JSON/YAML config file and logging.config.dictConfig, your config file should look like the following (assuming YAML concrete syntax):

formatters:
    syslog:
        (): syslog_rfc5424_formatter.RFC5424Formatter

handlers:
    syslog:
        formatter: syslog
        class: logging.handlers.SysLogHandler
        address: "/path/to/syslog/socket"
        facility: "ext://logging.handlers.SysLogHandler.LOG_USER"

root:
    level: INFO
    handlers:
        - syslog

License

This work is licensed under the ISC license, the text of which can be found at LICENSE.txt.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc