OVH library bundle to send logs on Log Data Platform (LDP)
Project description
A python logging bundle to send logs using GELF on the OVH Logs Data Platform.
Quickstart
First, install logging-ldp using pip:
pip install -U logging-ldp
The following example shows how to send log in Graylog TCP input
import logging
from logging_ldp.formatters import LDPGELFFormatter
from logging_ldp.handlers import LDPGELFTCPSocketHandler
logger = logging.getLogger("ldp")
logger.setLevel(logging.DEBUG)
handler = LDPGELFTCPSocketHandler(hostname="gra1.logs.ovh.com")
handler.setFormatter(LDPGELFFormatter(token="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"))
logger.addHandler(handler)
logger.debug("hello !")
Requirements
Python >= 3.3
Project Links
- OVH Logs Data Platform
Homepage (FR): https://logs.ovh.com
Documentation: https://docs.ovh.com/fr/logs-data-platform/
- Graylog & GELF
Documentation: http://docs.graylog.org/en/latest/pages/gelf.html
Python logging-gelf: http://logging-gelf.readthedocs.io/
License
Licensed under BSD 3-Clause License or https://opensource.org/licenses/BSD-3-Clause.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
logging-ldp-0.0.7.tar.gz
(6.6 kB
view details)
File details
Details for the file logging-ldp-0.0.7.tar.gz
.
File metadata
- Download URL: logging-ldp-0.0.7.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee6f8a2565a77e703e2bcc63b63ec61311588adbef9ae7e186b643dbfb7fc766 |
|
MD5 | 7b4fc91a8d8b3e0cf22b1fccf7863405 |
|
BLAKE2b-256 | 0a6df0653145b5e47718f95e236f3ca3f6845218536254ca0b329749af8156aa |