You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

logging-ldp

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logging-ldp

OVH library bundle to send logs on Log Data Platform (LDP)

0.0.7
pipPyPI
Maintainers
2

Logging for OVH Logs Data Platform

.. image:: https://img.shields.io/pypi/v/logging-ldp.svg :target: https://pypi.python.org/pypi/logging-ldp/ :alt: Latest Version

.. image:: https://travis-ci.org/ovh/python-logging-ldp.svg?branch=master :target: https://travis-ci.org/ovh/python-logging-ldp :alt: Latest version

.. image:: https://readthedocs.org/projects/logging-ldp/badge/?version=latest :target: http://logging-ldp.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

A python logging bundle to send logs using GELF on the OVH Logs Data Platform.

Quickstart

First, install logging-ldp using pip <https://pip.pypa.io/en/stable/>_::

pip install -U logging-ldp

The following example shows how to send log in Graylog TCP input

.. code-block:: python

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

License

Licensed under BSD 3-Clause License <./LICENSE>_ or https://opensource.org/licenses/BSD-3-Clause.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts