Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

LogBunny/LogBunny-V1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

LogBunny

A logger for all your needs

View Demo · Report Bug · Request Feature

image

About The Project

Sabertooth is a drop in realtime logger with an interactive dashboard

Demo

2023-11-18.21-01-11.mp4

(back to top)

Built With

  • NextJS
  • ExpressJS

(back to top)

Getting Started

Backend

  • Move into the backend directory and run

npm

npm install

yarn

yarn
  • Add the environment variables based on the .example-env or as mentioned below
PORT=
MONGO_URI=
REDIS_HOST=
REDIS_PASS=
REDIS_PORT=
  • Build the project first with

npm

npm run build

yarn

yarn build
  • Run the project with

npm

npm run dev

yarn

yarn dev

Frontend

  • Move into the frontend directory and run

npm

npm install

yarn

yarn
  • Run the project with

npm

npm run dev

yarn

yarn dev

(back to top)

Usage

(back to top)

System Design

There are three endpoints

  • /ingest
  • /stream
  • /logs

/ingest endpoint

  • POST request, does two things,
    1. Adds the log into a BullMQ queue for later processing and insertion into the database
    2. Adds the data into a Redis publisher channel

/stream endpoint

  • GET request, realtime, Keep-Alive connection, subscribes to the Redis channel and shows the latest data live. You can append various query parameters to filter the logs

/logs endpoint

  • GET request, gets the entire log from the database. You can append various query parameters to filter the logs

For /stream and /logs endpoints,

Possible parameters:

  • level:debug
  • msg_regex:^redis$ --> Supports all regex
  • trace_id:a traceid
  • from_timestamp:2023-12-16T12:34 --> Must be timestamp
  • to_timestamp:2023-12-16T12:34 --> Must be timestamp

Example url: https://sabertooth.fly.dev/logs?from=2023-10-16T12:34&to=2025-12-16T12:34&level=info&resource_id=ew123eaa&trace_id=ed23133&span_id=eq23aa&commit=9bffcdd&parent_resource_id=awq12&msg_regex=^redis$

Roadmap

  • Searching on entire logfile
  • Implement search within specific date ranges.
  • Utilize regular expressions for search.
  • Allow combining multiple filters.
  • Provide real-time log ingestion and searching capabilities.
  • Implement role-based access to the query interface.
  • Batching entries to reduce number of db insertion calls

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.md for more information.

(back to top)

Contact

Your Name - @twitter_handle - [email protected]

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published