Skip to content

tailoryash/Centralized-Logging-System-Java

Repository files navigation

Centralized Logging System (Spring Boot WebFlux, R2DBC, Docker)

Requirements implemented:

  • Java 17+, Spring Boot 3.x WebFlux, PostgreSQL with R2DBC, Maven multi-module, Docker/Compose
  • Event-driven, bounded concurrency with backpressure
  • TCP/UDP log collection, enrichment via blacklist, forwarding to central server
  • Storage and querying with filtering; metrics on collector and server
  • Simulated Linux/Windows clients generating logs every 1–2s

Build

mvn clean package -DskipTests

Run

docker-compose up --build

Services:

  • Postgres: postgres:5432
  • Log Server API: http://localhost:8080
  • Log Collector: TCP 9000, UDP 9001, Metrics http://localhost:8090/metrics

API

  • Ingest metrics:
curl http://localhost:8080/metrics
curl http://localhost:8090/metrics
curl http://localhost:8080/logs?is.blacklisted=true&limit=5
curl http://localhost:8080/logs?service=windows-client&level=ERROR&username=Administrator&is.blacklisted=false&limit=20&sort=desc
curl http://localhost:8080/logs?service=linux-client&level=INFO&username=root&limit=5
  • Query logs with filters:
curl "http://localhost:8080/logs?service=linux-client&level=INFO&username=root&blacklisted=false&limit=20&sort=desc"
curl http://localhost:8080/logs?service=linux-client&limit=10

Concurrency & Backpressure

  • Reactive streams (Project Reactor) throughout
  • Non-blocking TCP/UDP using Reactor Netty
  • Bounded queues using onBackpressureBuffer with limits
  • Controlled parallelism via Reactor schedulers (bounded)
  • Graceful shutdown hooks close sockets and stop generators

Environment

Copy .env.example to .env to override defaults.

Tests

Run:

mvn test

Includes parsing/validation, blacklist enrichment, DB filter logic, and metrics unit tests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published