Skip to main content

A simple Kafka logger in Python.

Project description

## Kafka Logger for Python

### Why this exists?

There’s an existing python package that can send log to logstash through Kafka, but it has two problems:

1. It’s built on top of a specific python kafka package and it’s outdated, which left user no choice on which Kafka they can use. 2. It only uses default log formatting from python logging package, which doesn’t provide much useful information.

### Install

pip install kafka-logger

### Usage

import logging import KafkaLoggingHandler logger = logging.getLogger(‘python-logstash-logger’) logger.setLevel(logging.INFO) log_producer = KafkaProducer(bootstrap_servers=KAFKA_BROKER) logger.addHandler(KafkaLoggingHandler(log_producer, ‘app-log’))

Project details


Download files

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

Source Distribution

kafka-logger-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file kafka-logger-0.3.0.tar.gz.

File metadata

  • Download URL: kafka-logger-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for kafka-logger-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ae41351a926bc3aaf2b862402722308631036748ca07cadf1b3256763601d832
MD5 cbe903ab7648d1cc0ff5e0e1760af02c
BLAKE2b-256 975ba3a7daf5f5eeac6b1a984654b96339f024dafa4b3a6620339cb6ccd11e09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page