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

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-1.0.2.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-1.0.2-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dnif-1.0.2.tar.gz.

File metadata

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

File hashes

Hashes for dnif-1.0.2.tar.gz
Algorithm Hash digest
SHA256 45cd0d6ee31a88cd65b156301220e01496e32e4beb7627d8829ae18b9228260b
MD5 b80db2fa3e04cf06de21e118055f6734
BLAKE2b-256 3401358d7d6c560f998179432291312f66bd3078cbf86e55e98ce451006d55e2

See more details on using hashes here.

File details

Details for the file dnif-1.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dnif-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b55d3aa9d7921e3c698f3fd093e1d337dc13182a605b0c62804829c889a5237f
MD5 0e48fa30f03d95aca56917669f029e56
BLAKE2b-256 c9bb355a3c6fb0e463563b87d57cabbde8fa63086eff1ece05af53f0d3bae344

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