Skip to main content

DNIF Logging Client Library

Project description

This is the official Python DNIF client library. This allows you to directly write log statements into your application code and integrate it with DNIF Adapters.

Installation

You can download the library using pip, as:

$ pip install dnif-logger

Getting Started

The DNIF library currently supports two ingestion mechanisms: 1. TCP protocol uploads using the HTTP(S) endpoint 2. Uploads using the UDP protocol

Typical usages for both of these are given below.

TCP

from dnif.consumer import AsyncHttpConsumer
from dnif.logger import DnifLogger
dlog = DnifLogger(AsyncHttpConsumer('http://TARGET_IP:PORT/json/receive'))
dlog.log({'key': 'value'})

The AsyncHttpConsumer is thread-safe, so you can use the same instance across threads (recommended).

UDP

from dnif.consumer import AsyncUDPConsumer
from dnif.logger import DnifLogger
dlog = DnifLogger(AsyncUDPConsumer('UDP_IP', UDP_PORT))
dlog.log('Hello World')

The AsyncUDPConsumer is thread-safe, so you can use the same instance across threads (recommended).

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

dnif-logger-1.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dnif_logger-1.0.1-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dnif-logger-1.0.1.tar.gz.

File metadata

  • Download URL: dnif-logger-1.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dnif-logger-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b3af518ac423073a76719ca240f7205d1cc297349b0a2e6faf3c8ba2c80b7db4
MD5 85a7c2c5ed337f23f5aabd1d3ed14cfb
BLAKE2b-256 b2080c9faa7615e44c94de6b67f1f2bf06f3ecf0f2e92f1e1688c403ca246ed7

See more details on using hashes here.

File details

Details for the file dnif_logger-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dnif_logger-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e314d4157b3b9b33bd76daae1ba38e8c7be4efd2f5320ef4bb994ada9912ccaa
MD5 8def5540f8f0beb66f0f0f135d2837f1
BLAKE2b-256 1a74e6652fb393718345fa6cca3eaf41595d3a79b9fd02ddac4c83c47396bd09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page