Send Message To Cloud Kafka Topic
Project description
Kafka Package
This is a simple package which sends log messages to Cloud Kafka Topic.
Version
Python == 3.X
Dependency
confluent-kafka>=0.11.6
Installation
Run the following to install
pip install cloud-kafka-logger
Usage
import logging
from cloudKafkaLogger import KafkaHandler
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
conf = {
'bootstrap.servers': 'cloud-kafka-servers',
'session.timeout.ms': 6000,
'default.topic.config': {'auto.offset.reset': 'smallest'},
'security.protocol': 'your-protocol',
'sasl.mechanisms': 'your-mechanisms',
'sasl.username': 'your-username',
'sasl.password': 'your-password'
}
kh = KafkaHandler(conf=conf, topic='your-topic')
logger.addHandler(kh)
This will be written into Kafka Topic
logger.info(json.dumps({"app_name": "Test_Python_App", "message": "Am logging from application"}))
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Cloud_Kafka_Logger-0.1.7.tar.gz.
File metadata
- Download URL: Cloud_Kafka_Logger-0.1.7.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e35f4aee03b0341614ca242cf914342ab883712276ee9d8d7ac20de7afe01b42
|
|
| MD5 |
44c95b2a92a5a7404d055d3ec7dd1b97
|
|
| BLAKE2b-256 |
69fd892829a6632826c52b946220f34b40947916831498d89db1593807bdd1c4
|
File details
Details for the file Cloud_Kafka_Logger-0.1.7-py3-none-any.whl.
File metadata
- Download URL: Cloud_Kafka_Logger-0.1.7-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0838793451cde0932147c7d0603488bfd01b6149016b1a20dc6ea4e682233fab
|
|
| MD5 |
a64ca4fc25b3798f21e2825beab94395
|
|
| BLAKE2b-256 |
9c348817488cd1010847a6aaa305faa2a0ccbbb4a92c2d81fc08ccf47dc0c8b1
|