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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffe707b9e1baa4c4acfaa80a9653dd61e37cda7e450ffaf8868f4af33e245216 |
|
MD5 | 1fe92647ff48e0bb379ac2eee0213bc4 |
|
BLAKE2b-256 | e587716443c788c485ffc2c963e5a5b732a2d66dd0fb476f884c66c69ecd96ce |