{ "info": { "author": "Morgan Fainberg", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [], "description": "python-rfc5424-logging-formatter\n================================\n\nA Logging Formatter for Python's logging module to properly handle Syslog RFC5424 messages\n\n\nWhat is provided by this formatter\n----------------------------------\n\nA derived formatter than allows for isotime specification\nfor full RFC5424 compliancy (with corrected TZ format)\n\nFor a \"proper\" ISOTIME format, use \"%(isotime)s\" in a\nformatter instance of this class or a class derived from\nthis class. This is for a work-around where strftime\nhas no mechanism to produce timezone in the format of\n\"-08:00\" as required by RFC5424.\n\nThe '%(isotime)s' replacement will read in the record\ntimestamp and try and reparse it. This really is a\nproblem with RFC5424 and strftime. I am unsure if this\nwill be fixed in the future (in one or the other case)\n\nThis formatter has an added benefit of allowing for\n'%(hostname)s' to be specified which will return a '-'\nas specified in RFC5424 if socket.gethostname() returns\nbad data (exception).\n\n\nRFC5424 Format\n--------------\n\nRFC: http://tools.ietf.org/html/rfc5424\n\n__The RFC5424 Format should only be used when talking to a Syslog server\nover the network stack. Specifically the Linux KSyslog implementation\nstill uses RFC3164 format (and something akin to RSyslog still adheres\nto that)__\n\nThe RFC5424 format string should look somthing like:\n```\n%(isotime)s %(hostname)s %(name)s %(process)d - - %(message)s\n```\n\nThe section after the two \"- -\" is technically the message\nsection, and can have any data applied to it e.g.:\n```\n <...> %(levelname)s [%(module)s %(funcName)s] %(message)s\n```\n\nThe '- -' section is the \"msg ID\" and \"Structured-Data\" Elements,\nrespectively\n\n\nExample usage of the formatter\n-------------------------------\n\n```python\n\n import logging\n\n logger = logging.getLogger('rfc5424_example')\n handler = logging.handlers.SysLogHandler(address=
)\n format = '%(isotime)s %(hostname)s %(name)s %(process)d - - %(message)s'\n formatter = RFC5424Syslog(format)\n\n handler.setFormatter(formatter)\n\n logger.addHandler(handler)\n\n logger.info('RFC5424 Log Message Format in use')\n```\n\nLicense\n-------\n\n Copyright (C) 2013 Morgan Fainberg and Metacloud, Inc\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 2 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/morganfainberg/python-rfc5424-logging-formatter", "keywords": "", "license": "GPLv2", "maintainer": null, "maintainer_email": null, "name": "rfc5424syslog", "package_url": "https://pypi.org/project/rfc5424syslog/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rfc5424syslog/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/morganfainberg/python-rfc5424-logging-formatter" }, "release_url": "https://pypi.org/project/rfc5424syslog/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "A Logging Formatter for Python's logging module to properly handle Syslog RFC5424 messages", "version": "0.0.1" }, "last_serial": 1048877, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c54fc672277c445e115d45fb58e52925", "sha256": "6ee2f87d44fa92f81cf9d3c9e8ea0571e9469e4589a6da5f55271f916ef786ed" }, "downloads": -1, "filename": "rfc5424syslog-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c54fc672277c445e115d45fb58e52925", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3137, "upload_time": "2014-04-02T12:22:12", "url": "https://files.pythonhosted.org/packages/ff/91/530aeba0b5389a3cde2771111f53d3b37728e99522be0d3012457032c3d6/rfc5424syslog-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c54fc672277c445e115d45fb58e52925", "sha256": "6ee2f87d44fa92f81cf9d3c9e8ea0571e9469e4589a6da5f55271f916ef786ed" }, "downloads": -1, "filename": "rfc5424syslog-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c54fc672277c445e115d45fb58e52925", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3137, "upload_time": "2014-04-02T12:22:12", "url": "https://files.pythonhosted.org/packages/ff/91/530aeba0b5389a3cde2771111f53d3b37728e99522be0d3012457032c3d6/rfc5424syslog-0.0.1.tar.gz" } ] }