This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A Logging Formatter for Python's logging module to properly handle Syslog RFC5424 messages

What is provided by this formatter

A derived formatter than allows for isotime specification
for full RFC5424 compliancy (with corrected TZ format)

For a "proper" ISOTIME format, use "%(isotime)s" in a
formatter instance of this class or a class derived from
this class. This is for a work-around where strftime
has no mechanism to produce timezone in the format of
"-08:00" as required by RFC5424.

The '%(isotime)s' replacement will read in the record
timestamp and try and reparse it. This really is a
problem with RFC5424 and strftime. I am unsure if this
will be fixed in the future (in one or the other case)

This formatter has an added benefit of allowing for
'%(hostname)s' to be specified which will return a '-'
as specified in RFC5424 if socket.gethostname() returns
bad data (exception).

RFC5424 Format


__The RFC5424 Format should only be used when talking to a Syslog server
over the network stack. Specifically the Linux KSyslog implementation
still uses RFC3164 format (and something akin to RSyslog still adheres
to that)__

The RFC5424 format string should look somthing like:
%(isotime)s %(hostname)s %(name)s %(process)d - - %(message)s

The section after the two "- -" is technically the message
section, and can have any data applied to it e.g.:
<...> %(levelname)s [%(module)s %(funcName)s] %(message)s

The '- -' section is the "msg ID" and "Structured-Data" Elements,

Example usage of the formatter


import logging

logger = logging.getLogger('rfc5424_example')
handler = logging.handlers.SysLogHandler(address=<address of="" syslogserver="">)
format = '%(isotime)s %(hostname)s %(name)s %(process)d - - %(message)s'
formatter = RFC5424Syslog(format)


logger.addHandler(handler)'RFC5424 Log Message Format in use')


Copyright (C) 2013 Morgan Fainberg and Metacloud, Inc

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http:"" licenses=""/>.
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
rfc5424syslog-0.0.1.tar.gz (3.1 kB) Copy SHA256 Checksum SHA256 Source Apr 2, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting