guvicorn_logger


Nameguvicorn_logger JSON
Version 0.1.17 PyPI version JSON
download
home_pagehttps://github.com/carlos-rian/guvicorn_logger
SummaryColored, normalizes and joins logs between Uvicorn and Gunicorn.
upload_time2024-06-24 12:14:01
maintainerNone
docs_urlNone
authorcarlos.rian
requires_python<4.0,>=3.8
licenseMIT
keywords gunicorn uvicorn logs logging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Guvicorn_logger

This lib colored, normalizes and joins logs between Uvicorn and Gunicorn.
There is a common problem when using Uvicorn for Dev and Gunicorn for Prod, 
normally the logs generated by Uvicorn wokers are not captured by Gunicorn.

This lib facilitates this configuration...

#### Easy config
```python
from guvicorn_logger import Logger

logger = Logger().configure()
```

#### Example

```python
logger.info("Message - Info")
logger.error("Message - Error")
logger.warning("Message - Warning")
logger.critical("Message - Critical")
```
#### Output

- Framework (Uvicorn, Gunicorn, Fastapi)
![alt text](https://raw.githubusercontent.com/carlos-rian/guvicorn_logger/main/docs/img/framework-web.JPG)



### FastAPI | asgi-correlation-id

```python
from asgi_correlation_id import CorrelationIdMiddleware
from fastapi import FastAPI

from guvicorn_logger import Logger

app = FastAPI()


app.add_middleware(CorrelationIdMiddleware)


logger = Logger(correlation_id=True).configure()


@app.get("/")
def main():
    logger.info("Message - Info")
    logger.error("Message - Error")
    logger.warning("Message - Warning")
    logger.critical("Message - Critical")

```

#### Output

![alt text](https://raw.githubusercontent.com/carlos-rian/guvicorn_logger/main/docs/img/fastapi.png)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/carlos-rian/guvicorn_logger",
    "name": "guvicorn_logger",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "gunicorn, uvicorn, logs, logging",
    "author": "carlos.rian",
    "author_email": "crian.rian@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/57/a1/79ca19c7fbbd8370185ba0b524280789f327318c46e8525def3b6362096f/guvicorn_logger-0.1.17.tar.gz",
    "platform": null,
    "description": "## Guvicorn_logger\n\nThis lib colored, normalizes and joins logs between Uvicorn and Gunicorn.\nThere is a common problem when using Uvicorn for Dev and Gunicorn for Prod, \nnormally the logs generated by Uvicorn wokers are not captured by Gunicorn.\n\nThis lib facilitates this configuration...\n\n#### Easy config\n```python\nfrom guvicorn_logger import Logger\n\nlogger = Logger().configure()\n```\n\n#### Example\n\n```python\nlogger.info(\"Message - Info\")\nlogger.error(\"Message - Error\")\nlogger.warning(\"Message - Warning\")\nlogger.critical(\"Message - Critical\")\n```\n#### Output\n\n- Framework (Uvicorn, Gunicorn, Fastapi)\n![alt text](https://raw.githubusercontent.com/carlos-rian/guvicorn_logger/main/docs/img/framework-web.JPG)\n\n\n\n### FastAPI | asgi-correlation-id\n\n```python\nfrom asgi_correlation_id import CorrelationIdMiddleware\nfrom fastapi import FastAPI\n\nfrom guvicorn_logger import Logger\n\napp = FastAPI()\n\n\napp.add_middleware(CorrelationIdMiddleware)\n\n\nlogger = Logger(correlation_id=True).configure()\n\n\n@app.get(\"/\")\ndef main():\n    logger.info(\"Message - Info\")\n    logger.error(\"Message - Error\")\n    logger.warning(\"Message - Warning\")\n    logger.critical(\"Message - Critical\")\n\n```\n\n#### Output\n\n![alt text](https://raw.githubusercontent.com/carlos-rian/guvicorn_logger/main/docs/img/fastapi.png)",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Colored, normalizes and joins logs between Uvicorn and Gunicorn.",
    "version": "0.1.17",
    "project_urls": {
        "Homepage": "https://github.com/carlos-rian/guvicorn_logger",
        "Repository": "https://github.com/carlos-rian/guvicorn_logger"
    },
    "split_keywords": [
        "gunicorn",
        " uvicorn",
        " logs",
        " logging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6adb372df0e331a981721c6253a5e5cba851591dff13866e68d2eed28bc27a71",
                "md5": "5dfb119b55bdd243540f5db6c81e6a31",
                "sha256": "3a65ce9522d11ada1ad7263be6894ab82bfc0784c29a9407b0b3599fef1024c2"
            },
            "downloads": -1,
            "filename": "guvicorn_logger-0.1.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5dfb119b55bdd243540f5db6c81e6a31",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 4607,
            "upload_time": "2024-06-24T12:13:59",
            "upload_time_iso_8601": "2024-06-24T12:13:59.858876Z",
            "url": "https://files.pythonhosted.org/packages/6a/db/372df0e331a981721c6253a5e5cba851591dff13866e68d2eed28bc27a71/guvicorn_logger-0.1.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57a179ca19c7fbbd8370185ba0b524280789f327318c46e8525def3b6362096f",
                "md5": "35a8cae505b0970434e4b04707981f35",
                "sha256": "36d75fc8dee2be375c197af4cfa030e3e27e292ce432ffd0f4a46ac8c8e1a74a"
            },
            "downloads": -1,
            "filename": "guvicorn_logger-0.1.17.tar.gz",
            "has_sig": false,
            "md5_digest": "35a8cae505b0970434e4b04707981f35",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 3748,
            "upload_time": "2024-06-24T12:14:01",
            "upload_time_iso_8601": "2024-06-24T12:14:01.738627Z",
            "url": "https://files.pythonhosted.org/packages/57/a1/79ca19c7fbbd8370185ba0b524280789f327318c46e8525def3b6362096f/guvicorn_logger-0.1.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-24 12:14:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "carlos-rian",
    "github_project": "guvicorn_logger",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "guvicorn_logger"
}
        
Elapsed time: 0.25813s