Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

A python logging handler that sends logs via Telegram Bot Api.

Project Description

A python logging handler that sends logs via Telegram Bot Api


Via pip:

pip install python-telegram-handler


Register a new telegram bot and obtain a authentication token. (Instructions here

After that, you must obtain a chat_id. You can do that using included simple script. Start a new conversation with newly created bot, write something to it (it is important to initiate conversation first).

Then run a command:

telegram_handler <your token here>

If all went ok, a chat_id will be printed to stdout.

Using token and chat_id, configure log handler in your desired way. For example, using dictConfig:

    'version': 1,
    'handlers': {
        'telegram': {
            'class': 'telegram_handler.TelegramHandler',
            'token': 'your token',
            'chat_id': 'chat id'
    'loggers': {
        'my_logger': {
            'handlers': ['telegram'],
            'level': 'DEBUG'


0.1.0 (2016-04-19)

  • Initial release

Release History

This version
History Node


History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(6.5 kB) Copy SHA256 Hash SHA256
Source Apr 19, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting