Skip to main content

A Python logging handler library for Kafka consumers.

Project description

Downloads

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for kafka-logging-handler, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size kafka_logging_handler-0.2.3-py2.7.egg (10.8 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size kafka_logging_handler-0.2.3-py2-none-any.whl (18.5 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size kafka_logging_handler-0.2.3-py3.6.egg (10.8 kB) File type Egg Python version 3.6 Upload date Hashes View
Filename, size kafka_logging_handler-0.2.3-py3-none-any.whl (18.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size kafka-logging-handler-0.2.3.tar.gz (18.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page