sag-py-logging-logstash


Namesag-py-logging-logstash JSON
Version 2.3.7 PyPI version JSON
download
home_pagehttps://github.com/SamhammerAG/sag_py_logging_logstash
SummaryPython logging logstash handler
upload_time2024-02-06 12:31:49
maintainer
docs_urlNone
authorSamhammer AG
requires_python>=3.8
licenseMIT
keywords logging logstash
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # sag_py_logging_logstash

[![Maintainability][codeclimate-image]][codeclimate-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![Known Vulnerabilities](https://snyk.io/test/github/SamhammerAG/sag_py_logging_logstash/badge.svg)](https://snyk.io/test/github/SamhammerAG/sag_py_logging_logstash)

[coveralls-image]:https://coveralls.io/repos/github/SamhammerAG/sag_py_logging_logstash/badge.svg?branch=master
[coveralls-url]:https://coveralls.io/github/SamhammerAG/sag_py_logging_logstash?branch=master
[codeclimate-image]:https://api.codeclimate.com/v1/badges/5e8f1c5bef6aeecd543d/maintainability
[codeclimate-url]:https://codeclimate.com/github/SamhammerAG/sag_py_logging_logstash/maintainability


Python Logstash Async is an asynchronous Python logging handler to submit
log events to a remote Logstash instance.
It based on  open source library, see the documentation http://python-logstash-async.readthedocs.io/en/latest/.
In this version transporter is limited to HTTPTransport, according to  Logstash intern installation requirements.

Unlike most other Python Logstash logging handlers, this package works asynchronously
by collecting log events from Python's logging subsystem and then transmitting the
collected events in a separate worker thread to Logstash.
This way, the main application (or thread) where the log event occurred, doesn't need to
wait until the submission to the remote Logstash instance succeeded.

This is especially useful for applications like websites or web services or any kind of
request serving API where response times matter.

## Usage

Example::

    from logstash_async.handler import AsynchronousLogstashHandler
    from logstash_async.formatter import LogstashFormatter
    import logging

    logstash_handler = AsynchronousLogstashHandler(
        host='my_host',
        port=123,
        username='my_user',
        password='my_password',
        index_name = 'my_index')
    logstash_formatter = LogstashFormatter( extra_prefix='',
    extra={'customer': "name", 'ap_environment': "local"})
    logstash_handler.setFormatter(logstash_formatter)

    logging_handlers = []
    logging_handlers.append(logstash_handler)

    logging.basicConfig(
    level="INFO",
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    handlers=logging_handlers)

    logging.getLogger().info("Logging Message", extra = {'new_field':"value"})


### Installation
pip install sag-py-logging-logstash

## How to start developing

### With vscode

Just install vscode with dev containers extension. All required extensions and configurations are prepared automatically.

### With pycharm

* Install latest pycharm
* Install pycharm plugin BlackConnect
* Configure the python interpreter/venv
* pip install requirements-dev.txt
* pip install black[d]
* Ctl+Alt+S => Check Tools => BlackConnect => Trigger when saving changed files
* Ctl+Alt+S => Check Tools => BlackConnect => Trigger on code reformat
* Ctl+Alt+S => Click Tools => BlackConnect => "Load from pyproject.yaml" (ensure line length is 120)
* Ctl+Alt+S => Click Tools => BlackConnect => Configure path to the blackd.exe at the "local instance" config (e.g. C:\Python310\Scripts\blackd.exe)
* Ctl+Alt+S => Click Tools => Actions on save => Reformat code
* Restart pycharm

## How to publish
* Update the version in setup.py and commit your change
* Create a tag with the same version number
* Let github do the rest

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SamhammerAG/sag_py_logging_logstash",
    "name": "sag-py-logging-logstash",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "logging,logstash",
    "author": "Samhammer AG",
    "author_email": "support@samhammer.de",
    "download_url": "https://files.pythonhosted.org/packages/9e/76/66fd755b13f75bcdbc21e8191860e636c2f06af770a3c86e2bca127adaaf/sag-py-logging-logstash-2.3.7.tar.gz",
    "platform": null,
    "description": "# sag_py_logging_logstash\n\n[![Maintainability][codeclimate-image]][codeclimate-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Known Vulnerabilities](https://snyk.io/test/github/SamhammerAG/sag_py_logging_logstash/badge.svg)](https://snyk.io/test/github/SamhammerAG/sag_py_logging_logstash)\n\n[coveralls-image]:https://coveralls.io/repos/github/SamhammerAG/sag_py_logging_logstash/badge.svg?branch=master\n[coveralls-url]:https://coveralls.io/github/SamhammerAG/sag_py_logging_logstash?branch=master\n[codeclimate-image]:https://api.codeclimate.com/v1/badges/5e8f1c5bef6aeecd543d/maintainability\n[codeclimate-url]:https://codeclimate.com/github/SamhammerAG/sag_py_logging_logstash/maintainability\n\n\nPython Logstash Async is an asynchronous Python logging handler to submit\nlog events to a remote Logstash instance.\nIt based on  open source library, see the documentation http://python-logstash-async.readthedocs.io/en/latest/.\nIn this version transporter is limited to HTTPTransport, according to  Logstash intern installation requirements.\n\nUnlike most other Python Logstash logging handlers, this package works asynchronously\nby collecting log events from Python's logging subsystem and then transmitting the\ncollected events in a separate worker thread to Logstash.\nThis way, the main application (or thread) where the log event occurred, doesn't need to\nwait until the submission to the remote Logstash instance succeeded.\n\nThis is especially useful for applications like websites or web services or any kind of\nrequest serving API where response times matter.\n\n## Usage\n\nExample::\n\n    from logstash_async.handler import AsynchronousLogstashHandler\n    from logstash_async.formatter import LogstashFormatter\n    import logging\n\n    logstash_handler = AsynchronousLogstashHandler(\n        host='my_host',\n        port=123,\n        username='my_user',\n        password='my_password',\n        index_name = 'my_index')\n    logstash_formatter = LogstashFormatter( extra_prefix='',\n    extra={'customer': \"name\", 'ap_environment': \"local\"})\n    logstash_handler.setFormatter(logstash_formatter)\n\n    logging_handlers = []\n    logging_handlers.append(logstash_handler)\n\n    logging.basicConfig(\n    level=\"INFO\",\n    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',\n    handlers=logging_handlers)\n\n    logging.getLogger().info(\"Logging Message\", extra = {'new_field':\"value\"})\n\n\n### Installation\npip install sag-py-logging-logstash\n\n## How to start developing\n\n### With vscode\n\nJust install vscode with dev containers extension. All required extensions and configurations are prepared automatically.\n\n### With pycharm\n\n* Install latest pycharm\n* Install pycharm plugin BlackConnect\n* Configure the python interpreter/venv\n* pip install requirements-dev.txt\n* pip install black[d]\n* Ctl+Alt+S => Check Tools => BlackConnect => Trigger when saving changed files\n* Ctl+Alt+S => Check Tools => BlackConnect => Trigger on code reformat\n* Ctl+Alt+S => Click Tools => BlackConnect => \"Load from pyproject.yaml\" (ensure line length is 120)\n* Ctl+Alt+S => Click Tools => BlackConnect => Configure path to the blackd.exe at the \"local instance\" config (e.g. C:\\Python310\\Scripts\\blackd.exe)\n* Ctl+Alt+S => Click Tools => Actions on save => Reformat code\n* Restart pycharm\n\n## How to publish\n* Update the version in setup.py and commit your change\n* Create a tag with the same version number\n* Let github do the rest\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python logging logstash handler",
    "version": "2.3.7",
    "project_urls": {
        "Bug Reports": "https://github.com/SamhammerAG/sag_py_logging_logstash/issues",
        "Documentation": "https://github.com/SamhammerAG/sag_py_logging_logstash",
        "Homepage": "https://github.com/SamhammerAG/sag_py_logging_logstash",
        "Source": "https://github.com/SamhammerAG/sag_py_logging_logstash"
    },
    "split_keywords": [
        "logging",
        "logstash"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1eac37afee47e3c637ba0ed10cc8b29f95128f5c961ca7a35724d6e87e19466b",
                "md5": "26695108f26a7ee7aaa6dbe47ac0a6d2",
                "sha256": "699e7126aa000c3dc3444d3f15d61b08455c7d8eb2a82d183fd6dfcf305ee2c2"
            },
            "downloads": -1,
            "filename": "sag_py_logging_logstash-2.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "26695108f26a7ee7aaa6dbe47ac0a6d2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 16792,
            "upload_time": "2024-02-06T12:31:48",
            "upload_time_iso_8601": "2024-02-06T12:31:48.165258Z",
            "url": "https://files.pythonhosted.org/packages/1e/ac/37afee47e3c637ba0ed10cc8b29f95128f5c961ca7a35724d6e87e19466b/sag_py_logging_logstash-2.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e7666fd755b13f75bcdbc21e8191860e636c2f06af770a3c86e2bca127adaaf",
                "md5": "23a11f777461322b4bc14126ada03aa7",
                "sha256": "39e7e08c3bdb8cf882ad36ab209fdeccaea95d36775dfedc4db50466cfee94b9"
            },
            "downloads": -1,
            "filename": "sag-py-logging-logstash-2.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "23a11f777461322b4bc14126ada03aa7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14853,
            "upload_time": "2024-02-06T12:31:49",
            "upload_time_iso_8601": "2024-02-06T12:31:49.863918Z",
            "url": "https://files.pythonhosted.org/packages/9e/76/66fd755b13f75bcdbc21e8191860e636c2f06af770a3c86e2bca127adaaf/sag-py-logging-logstash-2.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-06 12:31:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SamhammerAG",
    "github_project": "sag_py_logging_logstash",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "sag-py-logging-logstash"
}
        
Elapsed time: 0.24112s