Skip to main content

Logging formatter which produces well-formatted RFC5424 Syslog Protocol messages

Project description

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

Build Status 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syslog-rfc5424-formatter-1.2.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

syslog_rfc5424_formatter-1.2.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

syslog_rfc5424_formatter-1.2.2-py2-none-any.whl (4.2 kB view details)

Uploaded Python 2

File details

Details for the file syslog-rfc5424-formatter-1.2.2.tar.gz.

File metadata

  • Download URL: syslog-rfc5424-formatter-1.2.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.3

File hashes

Hashes for syslog-rfc5424-formatter-1.2.2.tar.gz
Algorithm Hash digest
SHA256 da6a2c87280d6f26b0188ca21e4608599db17dccc791c3291b662dbd78626e84
MD5 add4710cc5580cd186447c4cab2e3c3e
BLAKE2b-256 457595ca5b9fbc31f850a2f84da8302cc0eca1420e12c7e6064dda1569d5882e

See more details on using hashes here.

File details

Details for the file syslog_rfc5424_formatter-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: syslog_rfc5424_formatter-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.3

File hashes

Hashes for syslog_rfc5424_formatter-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7d574baf3555cdc27fc3d19c2c84f402816574cebcb1bd312f1783b0439f6410
MD5 513bc5fad4c1c8f6fe175abe2b862e5f
BLAKE2b-256 a8a224fb5bb0f8680b1001381a82c5b2e2d9ab50dba22127302862916b2d878c

See more details on using hashes here.

File details

Details for the file syslog_rfc5424_formatter-1.2.2-py2-none-any.whl.

File metadata

  • Download URL: syslog_rfc5424_formatter-1.2.2-py2-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.3

File hashes

Hashes for syslog_rfc5424_formatter-1.2.2-py2-none-any.whl
Algorithm Hash digest
SHA256 dbaf7ef02b6bd9b620617e5e6204068a21fba7e9aabfdd84840b2938e6a406ae
MD5 4b7c37e49733f238834e1efc7a7501bc
BLAKE2b-256 1cd48544eb074474c60a8c252adcd5f5e85eb400d6afe834c5be9a345d0802e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page