Skip to main content

A more up-to-date, RFC5424-Compliant syslog handler for the Python logging framework

Project description

https://img.shields.io/pypi/v/rfc5424-logging-handler.svg https://travis-ci.org/jobec/rfc5424-logging-handler.svg?branch=master https://codecov.io/github/jobec/rfc5424-logging-handler/coverage.svg?branch=master

A more up-to-date, RFC 5424 compliant syslog handler for the Python logging framework

Features

  • RFC 5424 Compliant

  • No need for complicated formatting strings

Installation

Python package:

pip install rfc5424-logging-handler

Usage

After installing you can use this package like this:

import logging
from rfc5424logging import Rfc5424SysLogHandler

logger = logging.getLogger('systlogtest')
logger.setLevel(logging.INFO)

sh = Rfc5424SysLogHandler(address=('10.0.0.1', 514))
logger.addHandler(sh)

msg_type = 'interesting'
logger.info('This is an %s message', msg_type)

This will send the following message to the syslog server:

<14>1 2020-01-01T05:10:20.841485+01:00 myserver syslogtest 5252 - - This is an interesting message

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

rfc5424-logging-handler-0.0.1.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

rfc5424_logging_handler-0.0.1-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

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