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
TelegramErrformerHandlerto 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
ErrformerMiddlewareto 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
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d002dab31683605eb94d0190085d926feb7050dc08251f877ac254ff0bffa9fc
|
|
| MD5 |
c92b3ac1917561b996f6feb0cdb60b1a
|
|
| BLAKE2b-256 |
6dc9074c1b346251103dd4f8d0e88c953e9dfd088be0233f0b07509581557fa7
|
File details
Details for the file django_errformer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: django_errformer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51a33b147ee310fa5924ca08887ec505650c4ec030decd58cfd3dce333b4a3b5
|
|
| MD5 |
a1b4a67b6fa3075ca0d651991a344274
|
|
| BLAKE2b-256 |
4d5bb94c484a5b46d35c4f3f3722cf091a56105cdf45c674f5fb914f2f7a1cb8
|