Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to use kafka-python==1.3.1 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions python_kafka_logging/KafkaHandler.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from kafka.client import KafkaClient
from kafka.client import SimpleClient
from kafka.producer import SimpleProducer, KeyedProducer
from kafka.conn import DEFAULT_SOCKET_TIMEOUT_SECONDS
import logging


class KafkaLoggingHandler(logging.Handler):

def __init__(self, hosts_list, topic, timeout_secs=DEFAULT_SOCKET_TIMEOUT_SECONDS, **kwargs):
def __init__(self, hosts_list, topic, **kwargs):
logging.Handler.__init__(self)

self.kafka_client = KafkaClient(hosts_list, timeout=timeout_secs)
self.kafka_client = SimpleClient(hosts_list)
self.key = kwargs.get("key", None)
self.kafka_topic_name = topic

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
kafka-python==0.9.5
kafka-python==1.3.1
logstash-formatter==0.5.8