Skip to main content

logging的飞书handler

Project description

feishu-logging-handler

通过webhook将自定义服务的消息推送至飞书

特点:

  • 支持异步,不需要等待http请求提高性能

安装

pip install feishu-logging-handler

配置

  • 创建一个飞书群组
  • 点击群设置,添加一个机器人,并生成Webhook地址
  • 可以设置关键词过滤

使用方式

初始化:

from feishu_logging.handler import FeiShuWebhookHandler
log_feishu = logging.getLogger("feishu")
http_handler = FeiShuWebhookHandler("https://open.feishu.cn/open-apis/bot/v2/hook/xxx","key_word")
http_handler.setLevel(logging.DEBUG)
log_feishu.addHandler(http_handler)

写日志:

log_feishu = logging.getLogger("feishu")
log_feishu.error("错误测试")

填入Webhook地址和关键词(或项目名称)即可

Project details


Download files

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

Source Distribution

feishu_logging_handler-1.0.2.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

feishu_logging_handler-1.0.2-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

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