log handler for send message to dingtalk
Project description
钉钉群告警Handler
通过钉钉群机器人, 发送Python日志到钉钉群
参考钉钉群机器人接口 https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq/26eaddd5
打包
python setup.py sdist
使用示例
import logging import logging.config LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': '[%(levelname)s %(asctime)s %(name)s %(funcName)s %(lineno)d %(process)d]\t%(message)s' }, }, 'handlers': { 'dingtalk':{ 'class': 'dingtalk_log_handler.DingTalkHandler', 'webhook': 'https://oapi.dingtalk.com/robot/send?access_token=XXXXX', # 'secret': '', # 'keyword': '', 'formatter':'verbose', 'level': 'ERROR', }, 'console': { 'level': 'INFO', 'class': 'logging.StreamHandler', 'formatter': 'verbose', }, }, 'loggers': { '': { 'handlers': ['dingtalk', 'console'], 'level': 'INFO', 'propagate': False, }, } } logging.config.dictConfig(LOGGING) logging.error('testing')
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
Close
Hashes for dingtalk-log-handler-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa7f33d76f6582cd2785225dca28e20b7e85cfa7b3bc01f84e58298a7bcda817 |
|
MD5 | d468d81567f4bc136574e69258e721f9 |
|
BLAKE2-256 | 3854c72c1d036feeb6db892fa6a285f7d15ece600752f6dfc067b1c7f4c16251 |
Close
Hashes for dingtalk_log_handler-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e610e40de1c99433b219096a96a9053043cd3aa29ed3e928f7511fd74ae47429 |
|
MD5 | 0cca1d46688b48ff9c9c36024d0ff92a |
|
BLAKE2-256 | 4b98882a143a60b3d2a31a054c7be91845e84a97689cbbe347fd378202fe20c6 |