Added sentry error logger

This commit is contained in:
Kylmakalle 2019-06-19 22:48:45 +03:00
parent 5b5e603b85
commit e51ad2eb44
3 changed files with 10 additions and 2 deletions

3
bot.py
View File

@ -113,7 +113,6 @@ async def all_errors_handler(dp, update, e):
user = update.callback_query.from_user.full_name
user_id = update.callback_query.from_user.id
logging.error(f'The update was: {update}')
logging.exception(traceback.print_exc())
logging.exception(f'The update was: {ujson.dumps(update.to_python(), indent=4)}', exc_info=True)
return True

View File

@ -53,3 +53,10 @@ AUDIO_API_VERSION = os.environ.get('API_VERSION', '5.78')
# https://www.miniwebtool.com/django-secret-key-generator/
# Возможно достаточно заглушки в стиле 'tgvkbot-super-secret-key(nope)'
SECRET_KEY = os.environ.get('SECRET_KEY', '!jh4wm=%s%l&jv7-lru6hg)mq2pk&rd@i*s0*c!v!zv01cf9iw')
SENTRY_URL = os.environ.get('SENTRY_URL', None)
if SENTRY_URL:
import sentry_sdk
sentry_sdk.init(SENTRY_URL)

View File

@ -13,6 +13,8 @@ multidict==4.1.0
Pillow==5.1.0
psycopg2-binary==2.7.4
pytz==2018.3
sentry-sdk==0.9.0
ujson==1.35
urllib3==1.25.3
wget==3.2
yarl==1.1.1