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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0408f45920e820a922972ca74edefed643f34f0527a15cb55b41d12ea12c9b96 |
|
MD5 | 247eeac62c9169cab337e95be2c3e7ea |
|
BLAKE2-256 | a0c558f2f8d0b8e1cc57bad576b1c3d9ab200ad4b040c0f19b05ce050054e2a6 |
Close
Hashes for dingtalk_log_handler-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c60ec860ae26a7088451046294e30ff6837b9468d897faeef6ed871e38c6b1a |
|
MD5 | f43214b44a6818c644c57a216953f254 |
|
BLAKE2-256 | a8fb4b3569c5ca633714f55dafb78e1080e160c6b6b2a18093da5599d1d777cd |