Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ralvke/logram
Utility that takes logs from anywhere and sends them to Telegram.
https://github.com/Ralvke/logram
bot systemd telegram
Last synced: about 1 month ago
JSON representation
Utility that takes logs from anywhere and sends them to Telegram.
- Host: GitHub
- URL: https://github.com/Ralvke/logram
- Owner: mxseev
- License: mit
- Created: 2017-11-05T06:25:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-26T01:40:36.000Z (almost 3 years ago)
- Last Synced: 2024-08-05T19:25:09.102Z (5 months ago)
- Topics: bot, systemd, telegram
- Language: Rust
- Homepage:
- Size: 166 KB
- Stars: 97
- Watchers: 3
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust - Ralvke/logram - ci.org/Ralvke/logram.svg?branch=master">](https://travis-ci.org/Ralvke/logram) (Applications / System tools)
- awesome-rust-zh - Ralvke/logram - 将日志文件的更新,推送到 Telegram[<img src="https://api.travis-ci.org/Ralvke/logram.svg?branch=master">](https://travis-ci.org/Ralvke/logram) (应用 / 系统工具)
- awesome-rust - Ralvke/logram - ci.org/Ralvke/logram.svg?branch=master">](https://travis-ci.org/Ralvke/logram) (应用 Applications / 系统工具 System tools)
- awesome-rust-cn - Ralvke/logram - ci.org/Ralvke/logram.svg?branch=master">](https://travis-ci.org/Ralvke/logram) (应用 / System tools)
README
# logram [![crates.io](https://img.shields.io/crates/v/logram.svg)](https://crates.io/crates/logram)
Utility that takes logs from anywhere and sends them to Telegram. Supports log collection from files, journald and docker containers. More about available log sources see at [`docs/log_sources.md`](docs/log_sources.md).
## Usage
1. Create a Telegram bot via [@BotFather](https://t.me/BotFather)
2. Download the [latest logram release](https://github.com/mxseev/logram/releases/tag/latest)
3. Install it:
- .deb based Linux: `sudo dpkg -i logram-...amd64.deb`
- .rpm based Linux: `sudo rpm -i logram-...x86_64.rpm`
4. Find out the chat id with your bot (see [`docs/chat_id.md`](docs/chat_id.md))
5. Change the config (`/etc/logram.yaml` in Linux) (see [`docs/config.md`](docs/config.md))
6. Run logram: `sudo systemctl start logram`
7. ... and add it to the autostart: `sudo systemctl enable logram`Also logram can work with `log`, see [`docs/lib.md`](docs/lib.md) for detals.
## Building
If you need to build a logram manually, do this:
1. Clone repo: `git clone [email protected]:mxseev/logram.git`
2. Choose the features you want:
- `bin_core` - required for all log sources
- `ls_counter` - Counter log source
- `ls_filesystem` - Filesystem log source
- `ls_journald` - Journald log source
- `ls_docker` - Docker log source
3. Build the project with these features: `cargo build --release --features=bin_core,ls_filesystem`### Making `.deb` package
1. Install [`cargo-deb`](https://github.com/mmstick/cargo-deb)
2. Edit `package.metadata.deb.features` in `Cargo.toml`
3. Build package: `cargo deb`
4. Use `target/debian/logram_..._amd64.deb`### Making `.rpm` package
1. Install [`cargo-generate-rpm`](https://github.com/cat-in-136/cargo-generate-rpm)
2. Build project: `cargo build --release --features=bin_core,...`
3. Strip debug symbols: `strip -s target/release/logram`
4. Build package: `cargo generate-rpm`
5. Use `target/generate-rpm/logram-...x86_64.rpm`