Log4j – XML based configuration

Log4j – XML configuration example Steps 1) Create Maven project Follow this post to create maven project and configure Log4j Steps 2) Create log4j.xml file Create log4j.xml file put inside src/main/resources package and add below content. For this example, I’m taking RollingFileAppender. Which means Read More …

Log4j – Configuring Appenders Programatically

Step 1) Create maven project. Follow the steps given in this post to create Maven Project Step 2) Get Log4j by adding below dependency in pom.xml and build the project 1 2 3 4 5 <dependency>     <groupId>log4j</groupId>     <artifactId>log4j</artifactId>     <version>1.2.17</version> </dependency> Step 3) Add AppendersByProgram.java class Read More …

Create Log4j project by using Maven dependency

5 Easy steps to create Log4j project using Maven dependency Step 1) Create maven project. Follow the steps given in this post to create Maven Project Step 2) Get Log4j by adding below dependency in pom.xml and build the project

Steps 3) Create log4j.properties file inside src/main/resources folder Read More …