Utility that takes logs from anywhere and sends them to Telegram.

Max Eliseev 483f1adb49 Merge pull request #10 from hugoh/docker-build 2 anni fa
assets 646a8575c7 downgrade systemd (for debian) & deb and rpm packages 3 anni fa
docs c2c028bc67 Docs, readme 3 anni fa
src 646a8575c7 downgrade systemd (for debian) & deb and rpm packages 3 anni fa
.editorconfig ded45786e5 From scratch 5 anni fa
.gitignore 992c133f64 gitignore .idea 3 anni fa
Cargo.lock 646a8575c7 downgrade systemd (for debian) & deb and rpm packages 3 anni fa
Cargo.toml 646a8575c7 downgrade systemd (for debian) & deb and rpm packages 3 anni fa
Dockerfile 4c8e4dcd57 Dockerfile for logram 2 anni fa
LICENSE 62eab37705 From scratch 3 anni fa
README.md cf64f9c674 unpack building section in readme 3 anni fa

README.md

logram crates.io

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.

Usage

  1. Create a Telegram bot via @BotFather
  2. Download the latest logram release
  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)
  5. Change the config (/etc/logram.yaml in Linux) (see 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 for detals.

Building

If you need to build a logram manually, do this:

  1. Clone repo: git clone git@github.com: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
  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
  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