Logram takes logs from files and systemd services and send them to Telegram.
Usage
- Download the latest release and install it:
sudo dpkg -i logram_..._amd64.deb
- Create bot via @BotFather
- Run logram in
echo_id
mode:logram echo_id --token=...
- Send any message to bot and he will answer chat id
- Change config at
/etc/logram.yaml
- Run via systemd:
sudo systemctl start logram
- Optionally: enable systemd service (for autostart):
sudo systemctl enable logram
log
Usage with - Load
logram
as library
[dependencies]
logram = "1.2"
- Init logram
use log::{debug, error, info, log, trace, warn, Level};
use logram;
fn main() {
logram::init(
"bot token".to_string(),
"chat id".to_string(),
Level::Error,
)
.unwrap();
error!("error");
}
Limitations: log records with target starts with tokio_reactor, hyper, mio, want or reqwest
will be skipped, because limitations in log.