Skip to main content

Send errors and logs to Telegram chat.

Project description

Errformer

Send errors and logs to Telegram chat.

Install

pip install django-errformer

Create a Telegram bot with @BotFather and get the token for it. This bot will be used to send messages to you.

Parameters

settings.py:

  • ERRFORMER_TELEGRAM_BOT_TOKEN - Telegram bot token (required)
  • ERRFORMER_ADMIN_CHAT_ID - Telegram chat id (your Telegram chat id, required)
  • ERRFORMER_INCLUDE_TRACEBACK - Include traceback in message (default: True)
  • ERRFORMER_PROJECT_NAME - Project name (not required)

Usage

  • Add TelegramErrformerHandler to logging handlers
LOGGING = {
    "handlers": {
        "level": "INFO",
        "telegram": {"class": "errformer.handlers.TelegramErrformerHandler"},
    },
    "loggers": {  # loggers for django.request, set your app name here
        "django": {
            "handlers": ["telegram", "console"],  # set handlers
            "level": "INFO",  # set log level
        },
    },
}
  • Add ErrformerMiddleware to middleware
MIDDLEWARE = [
    ...
    "errformer.middleware.ErrformerMiddleware",
]

Find DjangoErrformerBot in Telegram and tell it '/start', so that it can send messages to you.

License

MIT

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

django_errformer-0.1.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

django_errformer-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file django_errformer-0.1.1.tar.gz.

File metadata

  • Download URL: django_errformer-0.1.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for django_errformer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d002dab31683605eb94d0190085d926feb7050dc08251f877ac254ff0bffa9fc
MD5 c92b3ac1917561b996f6feb0cdb60b1a
BLAKE2b-256 6dc9074c1b346251103dd4f8d0e88c953e9dfd088be0233f0b07509581557fa7

See more details on using hashes here.

File details

Details for the file django_errformer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_errformer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51a33b147ee310fa5924ca08887ec505650c4ec030decd58cfd3dce333b4a3b5
MD5 a1b4a67b6fa3075ca0d651991a344274
BLAKE2b-256 4d5bb94c484a5b46d35c4f3f3722cf091a56105cdf45c674f5fb914f2f7a1cb8

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