Skip to content

The Logger is a simple HTTP server that accepts log entries and stores them in a MongoDB database.

License

Notifications You must be signed in to change notification settings

HeliosShieldProject/logger-rust

Helios | Logger

AGPL-3.0 License

The Logger is a simple HTTP server that accepts log entries and stores them in a MongoDB database.

Features

  • Accepts log entries via HTTP POST requests.
  • Stores log entries in a MongoDB database.
  • Minimal setup and easy to use.

Prerequisites

Before running the Logger, ensure you have the following installed:

  • Rust programming language and Cargo package manager
  • MongoDB server

Installation

  1. Clone the repository:

    git clone https://github.com/HeliosShieldProject/logger-rust.git
  2. Navigate to the project directory:

    cd logger-rust
  3. Install dependencies:

    cargo build --release

Usage

  1. Configure the environment variables in the .env file:

    MONGO_URL=<MongoDB connection URL>
    LOGGER_PORT=<Port number for the logger service>
    
  2. Run the Logger Service:

    cargo run
  3. Once the service is running, it will listen for HTTP POST requests at http://localhost:<LOGGER_PORT>/log.

  4. Send log entries to the service using HTTP POST requests with JSON payloads containing the log data.

Example

To send a log entry to the service, you can use tools like cURL or Postman. Here's an example using cURL:

curl -X POST -H "Content-Type: application/json" -d '{"message": "This is a log message"}' http://localhost:<LOGGER_PORT>/log

About

The Logger is a simple HTTP server that accepts log entries and stores them in a MongoDB database.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages