Skip to main content

在使用 nonebot 自带的 logger 写入 ERROR 级别以上的日志时,会自动发送至钉钉机器人

Project description

nonebot-plugin-dingtalk-logger

✨ 将错误日志推送至钉钉机器人的 NoneBot 插件 ✨

license pypi python

📖 介绍

在使用 nonebot 自带的 logger 写入 ERROR 级别以上的日志时,会自动发送至钉钉机器人

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-dingtalk-logger
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-dingtalk-logger
pdm
pdm add nonebot-plugin-dingtalk-logger
poetry
poetry add nonebot-plugin-dingtalk-logger

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_dingtalk_logger"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

配置项 必填 默认值 说明
DINGTALK_TOKEN 调用接口的凭证,钉钉提供的 Webhook 链接中 access_token 的值
DINGTALK_SECRET "" 安全密钥,安全设置项选择了加签后,提供的 SEC 开头的字符串
DINGTALK_KEYWORDS [] 自定义关键词,创建机器人时在安全设置项填入的所有关键词
DINGTALK_TIMEOUT None 请求超时时间
DINGTALK_LEVEL "ERROR" 日志转发等级

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

nonebot_plugin_dingtalk_logger-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file nonebot_plugin_dingtalk_logger-0.1.0.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_dingtalk_logger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0fe3f2127f6567afe0b9740f2d0075856063f7b1b68cb398531925bf991b6bcc
MD5 3d6ac6db5cf237663c3912cf57811558
BLAKE2b-256 048414cd319894a60028f97bbbe77dd8e9263426a04b9dbcc89214e143e57e4c

See more details on using hashes here.

File details

Details for the file nonebot_plugin_dingtalk_logger-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_dingtalk_logger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ecd22fec52e356fd4608f6a3c298e88569b069f01b706678be04907f6dc9ccf4
MD5 31832540683393edb7b03bc757f84169
BLAKE2b-256 1f023c2f545750cc8000e010fb3f4b08b95e7c05b5b7ea0ccf15e81fa1a81797

See more details on using hashes here.

Supported by

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