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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ba5b042f9ac310397b5ac6c9dce82767087cfd298de28601a47b91c52f7c1f4 |
|
MD5 | b92a28f6fc08dab42de357b3020767fe |
|
BLAKE2b-256 | afa8016513720db27f4aa4514e4c49e05a058910842cdcd42c17ce066f2fc96e |