Giter Site home page Giter Site logo

logpeek-server's Introduction

logpeek-server

Performant, web based log tail explorer written in Rust.

Features

  • Web based frontend. Allows for remote monitoring over the network.
  • Built-in dashboard. Contains system information, error count per hour over the last 24h and more.
  • Performance first. Log entries are kept in memory allowing for instant filtering. The exact amount is configurable.
  • Unlimited number of applications. Each application is configured separately, allowing for processing of log entries with different structures.
  • Portability. Distributed as a standalone binary. No installation required.
  • Regex based search. Regex is supported for both module and message filters.
  • Out-of-the-box compatibility with the logpeek crate. When using logpeek as the logger in your Rust application, the generated logs will be compatible by default.

Screenshots

Dashboard view image

Log table view image

Getting Started

Installation

You can find pre-built binaries for Linux, Windows and macOS on the releases page.

Building from source

Requirements (earlier versions will most likely work fine as well):

  • Rust (tested with 1.77.2)
  • Node.js (tested with 21.5.0)
git clone https://github.com/TheHighestBit/logpeek-server
cd logpeek-server/frontend
npm install
npm run build
cd ../backend
cargo build --release

The resulting binary can be found under backend/target/release.

Example setup and usage

Let's first have logpeek-server generate the default configuration file for us to modify. For this, simply run the application with the desired path to the configuration file as the argument: logpeek-server desired/path/to/config.toml. Alternatively, you can also find the template under /backend in the repo.

For a concrete example, let's say we have an application that is writing its log files to logs/example-app/ and the log entries are structured as follows:

INFO at 2024-01-17T13:55:36.713756700+02:00 from example-app::main - This is an INFO message!

We can tell logpeek-server how to read these log files by modifying the [[application]] section in config.toml:

[[application]]
path = "logs/example-app/"
parser = '''^(?P<level>\S+) at (?P<timestamp>\S+) from (?P<module>\S+) - (?P<message>.+)$'''
timeformat = "iso8601"
buffer_size = 1_000_000

Writing the regex parser was as simple as moving around the capture groups in the example found in config.toml and adding the separating words. For more complex formats, you might need to modify the regex a little bit more or have the message field capture the entire line.

For another example, let's also enable authentication by setting the secret in config.toml and a better maximum number of login attempts:

[main]
secret = "my_ultra_secret_password"
max_login_attempts = 5

Now we can start the server by simply running the executable and specifying the path to the configuration file: logpeek-server path/to/config.toml. The path can be omitted if the configuration file is named config.toml and is in the same directory as the binary.

Configuration

The recommended way of configuring logpeek-server is via a TOML file. Environment variables can be used as well, by prefixing them with LOGPEEK_.

Environment variables take precedence over the config.toml file.

Features planned for v0.3.0 release

  • Improved configuration. Using a .toml file like this is not very user-friendly. There should be a page in the frontend that would allow the user to edit the config more conveniently. The main reason this isn't implemented already is that the config library that is being used doesn't support writing to the config file and some refactoring might be necessary.

  • Reduce binary size. The current application is written without much regard for it's size. A lot of bloat can be removed.

  • Add parsers for common log formats as options on the configuration page. Altough regex is very powerful and flexible, it can be a bit intimidating for some users. Having a dropdown with common log formats would make the setup process easier.

License

This project is licensed under the MIT License - see the LICENSE file for details.

logpeek-server's People

Contributors

thehighestbit avatar

Stargazers

Leon avatar

Watchers

 avatar

Forkers

graphieros

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.