A Python logging handler library for Kafka consumers.
Project description
The following library simplifies the process of forwarding logs to a Kafka consumer.
How to Use
import logging
from kafka_logger.handlers import KafkaLoggingHandler
KAFKA_BOOTSTRAP_SERVER = ('<hostname:port>')
KAFKA_CA = '<path_to_ca_cert>'
TOPIC = '<publish_topic>'
logger = logging.getLogger('MyCoolProject')
# Instantiate your kafka logging handler object
kafka_handler_obj = KafkaLoggingHandler(KAFKA_BOOTSTRAP_SERVER,
TOPIC,
ssl_cafile=KAFKA_CA)
logger.addHandler(kafka_handler_obj)
# Set logging level
logger.setLevel(logging.DEBUG)
logger.info('Happy Logging!')
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
Close
Hashes for kafka-logging-handler-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a28ed9a29fe3e1e2f91e93c8894aadc44ef16df8d4d89d523e84795ecd72924a |
|
MD5 | 8892f161ad551baad37d67142d1efc02 |
|
BLAKE2b-256 | 4bd5ee73aa2cfc1b11276431b600601432ed4f11f5921f777ac0b79f8d5ffc5c |