{ "info": { "author": "Kumina", "author_email": "bartv@kumina.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: System :: Logging" ], "description": "\nThis Python module makes logging easy for your application. \nThe logger outputs JSON formatted logs for ingesting into Elastic. \n\nThe module implements the ECS (Elastic Common Schema) specification that\ncan be found at for quick reference: \n[ECS Field Reference](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html#ecs-field-reference)\n\n## Usage\n```python \n# Import \nfrom kubi_ecs_logger import Logger, Severity\n\n# Set some defaults in the start of your app\n# If in development mode the lib will output formatted json.\nLogger().dev = True\n# The minimum level of severity for outputing. E.g. If set to INFO then DEBUG logs will not \n# be printed to standard out\nLogger().severity_output_level = Severity.INFO\n# Set default key/value pairs for the different classes that will always be appended before final output\nLogger().defaults = {\n \"event\": {\n \"test\": \"test value\"\n }\n}\n\n# Log loaded configuration\nLogger().event(\n category=\"configuration\",\n action=\"configuration loaded\",\n dataset=\"The configuration is loaded from config.yaml\"\n).out(severity=Severity.INFO)\n\n# Output\n# {\n# \"@timestamp\": \"2019-07-11T15:11:03.193759+00:00\",\n# \"event\": {\n# \"action\": \"configuration loaded\",\n# \"category\": \"configuration\",\n# \"dataset\": \"The configuration is loaded from config.yaml\",\n# \"test\": \"test value\" # From defaults\n# },\n# \"logline\": {\n# \"level\": \"INFO\"\n# }\n# }\n\n# Here is a little bit bigger example\nLogger() \\\n .event(category=\"requests\", action=\"request received\") \\\n .url(path=\"/test\", domain=\"test.com\") \\\n .source(ip=\"123.251.512.152\") \\\n .http_response(status_code=200) \\\n .out(severity=Severity.INFO)\n\n# And here is the output of this one\n# {\n# \"@timestamp\": \"2019-07-11T15:15:48.896921+00:00\",\n# \"event\": {\n# \"action\": \"request received\",\n# \"category\": \"requests\",\n# \"test\": \"test value\" # From defaults\n# },\n# \"httpresponse\": {\n# \"status_code\": \"200\"\n# },\n# \"logline\": {\n# \"level\": \"INFO\"\n# },\n# \"source\": {\n# \"ip\": \"123.251.512.152\"\n# },\n# \"url\": {\n# \"domain\": \"test.com\",\n# \"path\": \"/test\"\n# }\n# }\n```\n\n## Dependencies\n| name | version |\n|-------------|---------|\n| marshmallow | 2.19.2 |", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "logging elasticsearch esc", "license": "", "maintainer": "", "maintainer_email": "", "name": "kubi-ecs-logger", "package_url": "https://pypi.org/project/kubi-ecs-logger/", "platform": "", "project_url": "https://pypi.org/project/kubi-ecs-logger/", "project_urls": { "Kumina": "https://kumina.nl/index", "Source": "https://github.com/kumina/kubi_ecs_logger" }, "release_url": "https://pypi.org/project/kubi-ecs-logger/0.0.5/", "requires_dist": null, "requires_python": ">=3.6, <4", "summary": "Logger based on Elasticsearch Common Schema.", "version": "0.0.5" }, "last_serial": 5517950, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "adc4fde9d6abad43f64ab26e649ab407", "sha256": "4206299f5e5006b50caa3270beba4bec1f50f792eeaec8a1274b8578aad1581b" }, "downloads": -1, "filename": "kubi_ecs_logger-0.0.5.tar.gz", "has_sig": false, "md5_digest": "adc4fde9d6abad43f64ab26e649ab407", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 14728, "upload_time": "2019-07-11T14:01:00", "url": "https://files.pythonhosted.org/packages/77/6c/b66d3bff535dc26c6feceab360cedc0ec35aa7abd9c7bf695c1caddc2951/kubi_ecs_logger-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "adc4fde9d6abad43f64ab26e649ab407", "sha256": "4206299f5e5006b50caa3270beba4bec1f50f792eeaec8a1274b8578aad1581b" }, "downloads": -1, "filename": "kubi_ecs_logger-0.0.5.tar.gz", "has_sig": false, "md5_digest": "adc4fde9d6abad43f64ab26e649ab407", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 14728, "upload_time": "2019-07-11T14:01:00", "url": "https://files.pythonhosted.org/packages/77/6c/b66d3bff535dc26c6feceab360cedc0ec35aa7abd9c7bf695c1caddc2951/kubi_ecs_logger-0.0.5.tar.gz" } ] }