Skip to main content

An app to send reports over Telegram API

Project description

DJANGO TELEGRAM LOGGING

This APP was developed on django to provide a simple way of sending error reports of django server via telegram bot API

Table of Contents

Instalation:

To instalate the appp just execute

# this command will install the app
$ pip install django-telegram-logging

Configuration:

Add django_telegram_logging to your installed apps.

INSTALLED_APPS = [
    ...
    'django_telegram_logging'
]

Add to your settings.py file the following variables needed. Is important to add this varaibles to your settings.py file before your logging settings. To get your personal token from Telegram read their documentation. By default TELEGRAM_LOGGING_EMIT_ON_DEBUG is set to false, but if you are running your project on DEBUG mode which you shouldn't, you can set this variable to True to emit the log.

TELEGRAM_LOGGING_TOKEN = 'XXXXXXX:XXXXXXXXXXXXXXXXX'
TELEGRAM_LOGGING_CHAT = 12345678
TELEGRAM_LOGGING_EMIT_ON_DEBUG = True

Follow django's documentation to configure logging, add the telegram handler to the handlers configuration, and add at least one logger which will use that handler.

LOGGING = {
    ...
    'handlers': {
        ...
        'telegram': {
            'level': 'ERROR',
            'class': 'django_telegram_logging.handler.TelegramHandler'
        },
    },
    'loggers': {
        ...
        'django': {
            'level': 'ERROR', 
            'handlers': ['console', 'telegram']
        }
    }
}

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_telegram_logging-1.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file django_telegram_logging-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_telegram_logging-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f348234252ca605172dbd90dd72067640bbf73aa7b98183cd520929c0fc1bcb
MD5 f0019e7eb2dae96a57833f6e6605552f
BLAKE2b-256 a789a89abcd6bbe607a019fb51acb0f89268782045adb2c168a840dcc9b5b529

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page