Skip to main content

py_kafka_logger

Gelf logger

config example:

kafka_logger:
  app_name: "app_name"
  bootstrap_servers:
    - "serv1:9092"
  topic: "log_topic"

usage:

from pathlib import Path

import yaml
import kafka_logger.kafka_logger

path = Path(__file__).resolve().parent / "config.yaml"
with path.open("r", encoding="utf-8") as handle:
    raw_config = (yaml.safe_load(handle) or {"kafka_logger": {}}).get("kafka_logger")
    settings = kafka_logger.kafka_logger.KafkaLoggerSettings(**raw_config)

kafka_logger.kafka_logger.KafkaLogger.init_producer(settings)

kl = kafka_logger.kafka_logger.KafkaLogger("test_service")

kl.info( "test_message", {"test_context": "text_value"})

Metadata

Release files for py-kafka-logger 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-kafka-logger 0.1.0
File Size Uploaded
py_kafka_logger-0.1.0.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-kafka-logger 0.1.0
File Interpreter ABI Platform
py_kafka_logger-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / py_kafka_logger-0.1.0.tar.gz

Download URL py_kafka_logger-0.1.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2eae1987a3d14d9f38e7ebb0bd7a92e76560e83de9f75c8f67cad9228bf2a7b5
BLAKE2b-256 checksum
How to use checksums
41ae32de71a3cb323710c3a2b1f5bdbdeba8d011e349d2308ddd369e075a415c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release files / py_kafka_logger-0.1.0-py3-none-any.whl

Download URL py_kafka_logger-0.1.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f21200e626e8da9674db22bc6c418f0ba887f2cc4b8b1db28c4cb009ef8ee6c
BLAKE2b-256 checksum
How to use checksums
d4243911e4c56ea4b88915172715da846261f205b704e9f94767d39bc4b77f89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page