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
Built Distribution
Close
Hashes for kafka-logging-handler-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 324cf8a70a0fa178e879a6ccf21203c4e147c53ffd8d758bba435e4466c62f89 |
|
MD5 | d1c1f81759cf6c1497b96500603da251 |
|
BLAKE2b-256 | f837659c3fc1a022acd73f6641b3b92650e4b5bd271209bf6172fb541a0307e6 |
Close
Hashes for kafka_logging_handler-0.1.2-py3.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4472b3c30a193ba84da7e2c18e96f3ddeef7bc471f5ebf881f132718f79d9aa6 |
|
MD5 | ea3072d3f490e03fd5770d017b5f65d2 |
|
BLAKE2b-256 | 75ca0f439ec5dcb2d538bcbaac79c2b43d7db505d6b7fb81014c55fe7c9dd737 |