A comprehensive demo project for Java logging using Log4j 2.x, covering basic to advanced usage. This project is designed to help developers understand and implement logging best practices in Java applications.
- Simple and advanced Log4j 2.x usage examples
- Custom appenders and log filtering
- Integration with external systems
- Pattern layouts and configuration
- Unit and integration tests with JUnit 5
- Modular, well-commented code following agent AI rules
- Clone the repository:
git clone https://github.com/hkevin01/log4j-demo.git
- Ensure JDK 11+ and Maven are installed.
- Build the project:
mvn clean install
- Run demo classes from
src/main/java/com/example/to see Log4j in action. - Example:
mvn exec:java -Dexec.mainClass="com.example.BasicLoggerDemo" - Explore advanced features in
AdvancedLoggerDemo.java.
- Unit tests are located in
src/test/java/com/example/. - Run all tests:
mvn test
- Project plan and workflow:
docs/project-plan.md,docs/WORKFLOW.md - Goals and audience:
docs/PROJECT_GOALS.md - Log4j features and usage: See code comments and user guide (to be completed)
- Please read
CONTRIBUTING.mdbefore submitting changes. - Follow the agent AI rules: meaningful comments, modular code, and maintainability.
MIT