logram-1.0.0 is not a library.
Visit the last successful build:
logram-2.0.0
logram - push logs updates to Telegram
Use
- Install Rust via Rustup
- Install logram:
cargo install logram
- Create bot via @BotFather
- Run logram in
echo id
mode:logram echo_id --token=...
- Send any message to bot and use chat id in config
- Write config from example
- Run logram
logram --config=...
- Create systemd service if needed
Config example
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
Systemd service
- Create link:
sudo ln -s /home/<user>/.cargo/bin/logram /usr/bin/logram
- Copy config to
/etc/logram.yaml
- Copy
logram.service
to/etc/systemd/system
- Reload services:
sudo systemctl daemon-reload
- Enable service:
sudo systemctl enable logram
- Run service:
sudo systemctl start logram