cargo install logram
echo id
mode: logram echo_id --token=...
logram --config=...
```yaml telegram: chat_id: 12345678 # chat id token: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 # bot token
sources: fs: entries: # paths to watching files or dirs - /tmp/log_file
journald: units: # names of systemd units for watching - docker.service - nginx.service ```
sudo ln -s /home/<user>/.cargo/bin/logram /usr/bin/logram
/etc/logram.yaml
logram.service
to /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable logram
sudo systemctl start logram
log
logram
as library
toml
[dependencies]
logram = "1.1"
fn main() { logram::init( "bot token".tostring(), "chat id".tostring(), 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.