Skip to content

hkevin01/log4j-demo

Repository files navigation

Log4j Demo

Overview

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.

Features

  • 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

Installation

  1. Clone the repository:
    git clone https://github.com/hkevin01/log4j-demo.git
  2. Ensure JDK 11+ and Maven are installed.
  3. Build the project:
    mvn clean install

Usage

  • 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.

Testing

  • Unit tests are located in src/test/java/com/example/.
  • Run all tests:
    mvn test

Documentation

Contribution Guidelines

  • Please read CONTRIBUTING.md before submitting changes.
  • Follow the agent AI rules: meaningful comments, modular code, and maintainability.

License

MIT

About

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.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors