This project implements an event-driven log processing system in Java.It parses structured application logs, converts each log entry into an immutable event, and processes those events through a flexible listener-based architecture.
The goal of this project is to demonstrate:
-
Strong object-oriented design
-
Event-based architecture
-
Proper use of interfaces
-
Application of common design patterns
This project follows a generator–event–listener model and is designed to be easily extensible.
-
Event-driven programming
-
Interface-based design
-
Observer (Listener) pattern
-
Factory Method pattern
-
Singleton pattern
-
Immutable domain objects
-
File I/O and log parsing
-
Clean and maintainable project structure
The system is organized into three main roles:
-
Represent immutable log entries
-
Extend java.util.EventObject
-
Expose log data through read-only getters
-
Responsible for creating LogEvent instances
-
Maintains a list of subscribed listeners
-
Notifies listeners whenever a new event is created
-
Implemented as a Singleton
-
Acts as a Factory for events
-
Subscribe to the generator
-
React to events independently
-
Can filter events or aggregate statistics
-
Do not modify events
-
LogParser reads the application.log file line by line
-
Each line is parsed into typed fields
-
LogGenerator creates a LogEvent
-
The generator notifies all registered listeners
-
Each listener independently reacts to the event
-
Clone the repository
-
Open the project in IntelliJ IDEA
-
Ensure application.log is present
-
Run Main.java
-
Check the output/ directory for generated files
-
Add unit tests (JUnit)
-
Support JSON or CSV output formats
-
Externalize configuration using a properties file
-
Allow listeners to subscribe to multiple filters
-
Improve error handling in log parsing