{ "info": { "author": "Dar\u00edo Blanco Iturriaga", "author_email": "dario@darioblanco.com", "bugtrack_url": null, "classifiers": [], "description": "logbook-logstash\n================\n\nJSON logs with logstash format for logbook\n\nThis library is provided to allow\n`logbook `__ logging to output log\ndata as json objects ready to be shipped out to logstash.\n\nThis project is a fork of\n`exoscale/python-logstash-formatter `__\n\nInstalling\n----------\n\nPip:\n\n::\n\n $ pip install logbook-logstash\n\nPypi:\n\nhttps://pypi.python.org/pypi/logbook-logstash\n\nManual:\n\n::\n\n $ python setup.py install\n\nUsage\n-----\n\nJson outputs are provided by the LogstashFormatter logging formatter,\nfor instance:\n\n.. code:: python\n\n\n import sys\n\n import logbook_logstash\n from logbook import Logger, StreamHandler\n\n\n log = Logger('testlog')\n\n handler = StreamHandler(sys.stdout)\n handler.formatter = logbook_logstash.LogstashFormatter()\n handler.push_application()\n\n log.info('My test')\n\nYou can provide extra variables, and show the exception traceback.\n\n.. code:: python\n\n\n log.info({\"account\": 123, \"ip\": \"172.20.19.18\"})\n log.info(\"classic message for account: %s\", account, extra={\"account\": account})\n\n try:\n h = {}\n h['key']\n except:\n log.info(\"something unexpected happened\", exc_info=True)\n\nSample output\n-------------\n\nThe following keys will be found in the output JSON:\n\n- ``@source_host``: source hostname for the log\n- ``@timestamp``: ISO 8601 timestamp\n- ``@message``: short message for this log\n- ``@fields``: all extra fields\n\n.. code:: python\n\n\n {\n \"@fields\": {\n \"account\": \"pyr\",\n \"args\": [],\n \"created\": 1367480388.013037,\n \"exception\": [\n \"Traceback (most recent call last):\\n\",\n \" File \\\"toto.py\\\", line 16, in \\n k['unknown']\\n\",\n \"KeyError: 'unknown'\\n\"\n ],\n \"filename\": \"toto.py\",\n \"funcName\": \"\",\n \"levelname\": \"WARNING\",\n \"levelno\": 30,\n \"lineno\": 18,\n \"module\": \"toto\",\n \"msecs\": 13.036966323852539,\n \"name\": \"root\",\n \"pathname\": \"toto.py\",\n \"process\": 1819,\n \"processName\": \"MainProcess\",\n \"relativeCreated\": 18.002986907958984,\n \"thread\": 140060726359808,\n \"threadName\": \"MainThread\"\n },\n \"@message\": \"TOTO\",\n \"@source_host\": \"phoenix.spootnik.org\",\n \"@timestamp\": \"2013-05-02T09:39:48.013158\"\n }\n\nTests\n-----\n\nThis project has basic tests, and uses the ``pytest`` library. Just\nexecute the following commands in the project root.\n\n::\n\n $ pip install -r dev-requirements.txt\n $ py.test", "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/sharkerz/logbook-logstash/", "keywords": null, "license": "LICENSE", "maintainer": null, "maintainer_email": null, "name": "logbook-logstash", "package_url": "https://pypi.org/project/logbook-logstash/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/logbook-logstash/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sharkerz/logbook-logstash/" }, "release_url": "https://pypi.org/project/logbook-logstash/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "JSON logstash formatter for logbook", "version": "0.1.3" }, "last_serial": 1332449, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9c2ad0ab24da053bb7e75eef251b3141", "sha256": "5b09556c90965321e72369fe3a0b9812d1610e33d9673c13581feceb8c77abee" }, "downloads": -1, "filename": "logbook-logstash-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9c2ad0ab24da053bb7e75eef251b3141", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3099, "upload_time": "2014-07-09T18:11:26", "url": "https://files.pythonhosted.org/packages/82/ed/def7d40c55bbd4672b62445cf4a1d56bdff3c78675fac61c40ac174813d0/logbook-logstash-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8e9ce2982e52b2d40a4e6df8839fa0f4", "sha256": "2e5a622ca43c6b4a55eb69fd5b36d3f70378426e4bbcaca64e89d7d477be4c3d" }, "downloads": -1, "filename": "logbook-logstash-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8e9ce2982e52b2d40a4e6df8839fa0f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3105, "upload_time": "2014-07-09T18:16:46", "url": "https://files.pythonhosted.org/packages/7f/14/ba8a2f397c523957dc2e12f3c1410896a284b200488834a24bec7bfa16c2/logbook-logstash-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "b08b25b9960f92a93836cf253c91b086", "sha256": "dcbd2220d648de2897aeb7bfea5d21c2698daa375e1904a871ec29ee348463b8" }, "downloads": -1, "filename": "logbook-logstash-0.1.2.tar.gz", "has_sig": false, "md5_digest": "b08b25b9960f92a93836cf253c91b086", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3393, "upload_time": "2014-07-09T18:18:30", "url": "https://files.pythonhosted.org/packages/00/03/4e081c37a46ef58d49f8791e70e3164a52056050b897e4e47b6edc048cdd/logbook-logstash-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "31630c96806290e7393b5c655db170a1", "sha256": "46ca474750b01b9e6ae8296f352f885e2f7a4e204c5ae87fcadad5d0ec2945b1" }, "downloads": -1, "filename": "logbook-logstash-0.1.3.tar.gz", "has_sig": false, "md5_digest": "31630c96806290e7393b5c655db170a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3681, "upload_time": "2014-12-05T19:02:10", "url": "https://files.pythonhosted.org/packages/f2/7d/154d425f54facdebf9d8f96bd95c745663d093fcaa80c1b2808218fc2bfb/logbook-logstash-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "31630c96806290e7393b5c655db170a1", "sha256": "46ca474750b01b9e6ae8296f352f885e2f7a4e204c5ae87fcadad5d0ec2945b1" }, "downloads": -1, "filename": "logbook-logstash-0.1.3.tar.gz", "has_sig": false, "md5_digest": "31630c96806290e7393b5c655db170a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3681, "upload_time": "2014-12-05T19:02:10", "url": "https://files.pythonhosted.org/packages/f2/7d/154d425f54facdebf9d8f96bd95c745663d093fcaa80c1b2808218fc2bfb/logbook-logstash-0.1.3.tar.gz" } ] }