Send log to Mixin Messenger Groups.
- Download from https://github.com/fox-one/echo/releases.
- Extract and upload
scanner
to server.
- Create a new group in Mixin Messenger
- add echo bot to it
- copy the token.
write a .env file
SCANNER_TOKEN_INFO=YOUR_TOKEN_TO_SEND_INFO_LOG
SCANNER_TOKEN_ERROR=YOUR_TOKEN_TO_SEND_ERROR_LOG
SCANNER_TOKEN_WARNING=YOUR_TOKEN_TO_SEND_WARNING_LOG
add echo as a service
[Unit]
Description=Scanner Service
After=network.target
[Service]
Type=simple
User=YOUR_NAME
Restart=on-failure
RestartSec=1s
EnvironmentFile=YOUR_ENV_FILE_PATH
ExecStart=/YOUR_ECHO_FILE_PATH/scanner --format post --cmd '["/bin/journalctl","-u","THE_SERVICE_YOU_WANNA_WATCH","-f","-o","cat"]'
[Install]
WantedBy=multi-user.target
- use
github.com/sirupsen/logrus
and enable json log format in your service. - restart all services
接收入群消息,然后自动发 token 给拉机器人进群的人
POST https://echo.yiplee.com/message
Header:
Authorization: Bearer access_token
Params:
{
"category": "Plain_Text",
"data": "base64 msg data"
}
一分钟一百个请求