Coder Social home page Coder Social logo

logram's Introduction

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 [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
  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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.