A scalable backend-style Java application that simulates a distributed log analytics system.
It ingests raw log files, processes events, computes metrics, detects anomalies, and persists results.
Built using:
- Core Java
- Multi-package architecture
- File I/O
- Stream API
- Thread-safe persistence
This project demonstrates real backend engineering practices such as modular design, analytics pipelines, and alerting systems.
β Log ingestion from files
β Event parsing into structured objects
β Metrics calculation (INFO / WARN / ERROR counts)
β Anomaly detection with alerting
β Thread-safe result persistence
β Clean package-based architecture
distributed-log-engine/ β βββ .vscode/ β βββ settings.json β βββ src/ β βββ com/logengine/ β βββ app/ β Application entry point β βββ analytics/ β Metrics & anomaly detection β βββ alert/ β Alert services β βββ model/ β Data models β βββ parser/ β Log ingestion β βββ processor/ β Processing pipeline β βββ persistence/ β Storage layer β βββ data/ β βββ sample-logs.txt β βββ analytics-results.txt β βββ README.md
From the project root:
rm -rf bin
mkdir bin
javac -d bin $(find src -name "*.java")
2οΈβ£ Run the application
java -cp bin com.logengine.app.Main
π Sample Input (data/sample-logs.txt)
INFO Application started
WARN Memory usage high
ERROR Null pointer exception
ERROR Database timeout
ERROR Disk failure
INFO User logged in
π Example Output
π Distributed Log Analytics Engine Starting...
π Metrics Summary:
INFO : 2
WARN : 1
ERROR : 3
π¨ ALERT: High error rate detected: 3
β
Done. Check data/analytics-results.txt
Results are saved to:
data/analytics-results.txt
π§© Architecture Overview
πΉ LogParser
Reads raw log files and returns lines.
πΉ LogProcessor
Transforms raw strings into structured LogEvent objects.
πΉ MetricsCalculator
Computes analytics metrics (INFO/WARN/ERROR counts).
πΉ AnomalyDetector
Detects high error rates and triggers alerts.
πΉ AlertService
Interface for alerting implementations (console-based for now).
πΉ ResultStore
Persists metrics and logs using thread-safe file writing.
π§ͺ Technologies Used
Java 17+
Java Streams
File I/O (NIO)
Concurrency (ReentrantLock)
Modular package structure
VS Code Java tooling
π Why This Project Matters
This project demonstrates:
Backend data pipelines
Analytics processing
Alerting systems
Clean object-oriented design
Real-world logging workflows
It reflects patterns used in:
Distributed systems
Observability platforms
Log monitoring tools
Enterprise backend services