Skip to main content

A Python logging handler that sends log messages to Telegram chats

Reason this release was yanked:

pre-alpha

Project description

TGBot-Logging

PyPI version Python Support Documentation Status License: MIT

A Python logging handler that sends log messages to Telegram chats.

Features

  • Send log messages to one or multiple Telegram chats
  • Support for HTML and MarkdownV2 formatting
  • Message batching for better performance
  • Automatic retries for failed messages
  • Customizable log format
  • Environment variables support

Quick Start

  1. Install the package:
pip install tgbot-logging
  1. Basic usage:
import logging
from tgbot_logging import TelegramHandler

# Create logger
logger = logging.getLogger('MyApp')
logger.setLevel(logging.DEBUG)

# Create TelegramHandler
telegram_handler = TelegramHandler(
    token='YOUR_BOT_TOKEN',
    chat_ids=['YOUR_CHAT_ID'],
    level=logging.INFO
)

# Add handler to logger
logger.addHandler(telegram_handler)

# Example usage
logger.info('This is an info message')

Documentation

Full documentation is available at tgbot-logging.readthedocs.io, including:

  • Detailed installation instructions
  • Configuration options
  • Advanced usage examples
  • API reference
  • Development guide

Development Installation

For development with testing tools and code formatting:

pip install -e ".[dev]"
# or
pip install -r requirements-dev.txt

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

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

tgbot_logging-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tgbot_logging-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file tgbot_logging-0.1.0.tar.gz.

File metadata

  • Download URL: tgbot_logging-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for tgbot_logging-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc8b5ca9b4c42669ce0eb477723843f5c5e3bb282e7ca3d517b199cad2f50345
MD5 dcabc14a70c23911092a835148cfefb8
BLAKE2b-256 762efaab462868b5729adcff8cacd15b9082e67edeadf3b8210d6e38197af23b

See more details on using hashes here.

File details

Details for the file tgbot_logging-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tgbot_logging-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for tgbot_logging-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47b56239c28396ec0896b8e0fb40aa7b8bf265a2b5e163231c420a631aa186d1
MD5 e1d551a25bd2af5e438f8c92b27eaa2b
BLAKE2b-256 c4b09d7503781afb0a60a24a921361eaae8b09c5b47801e74ea4c177ce3b787c

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