Library that provides classes for GELF logging!
Project description
Usage from a python script
import logging
import time
from uuid import uuid4
from gelf.handler import GELFHandlerTCP
logger = logging.getLogger("example.module")
logger.setLevel(logging.DEBUG)
handler = GELFHandlerTCP(
host="127.0.0.1",
port=12201,
service="example",
include_extra_fields=True,
debug=True,
)
handler.setLevel(logging.DEBUG)
logger.addHandler(handler)
logger.addHandler(logging.StreamHandler())
while True:
request_id = uuid4().hex
logger.debug(
"Something not that important", extra={"foo": "bar", "request_id": request_id}
)
logger.info(
"This message gives a lot of information",
extra={"foo": "bar", "request_id": request_id},
)
logger.error(
"Something went wrong!", extra={"foo": "bar", "request_id": request_id}
)
time.sleep(5)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gelf-0.0.1.tar.gz
(2.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
gelf-0.0.1-py3-none-any.whl
(3.1 kB
view details)
File details
Details for the file gelf-0.0.1.tar.gz.
File metadata
- Download URL: gelf-0.0.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa21facd9347ae4f142542e3896a97f1143cd35020e570661517fd27ee788286
|
|
| MD5 |
f368a689e43cff2e8bd8ddb4c87fdf1b
|
|
| BLAKE2b-256 |
be05b16a6bf20113c0b2aaf4f56558eaf5b008760de51c940ca190847fba6e9b
|
File details
Details for the file gelf-0.0.1-py3-none-any.whl.
File metadata
- Download URL: gelf-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
422906109b8581b6349d83660e570751d1122d36ec2f240c1b393d1d3f16a6f4
|
|
| MD5 |
017a6475f4ad6b598379e3b8dee7072d
|
|
| BLAKE2b-256 |
494a1987e81086c6660aa01f897b9bfde6f8c8d4dcb895603c3e77ed9edb60fe
|