Download and Add Log4j jars

Before starting the Log4j example first we need to add the Log4j jar file in our project. We can add Log4j jar dependency in our pom.xml under maven project. We can add below dependency:


If we are not using any build tools, then we can download the log4j jar from Apache Log4j Official page and include into our project classpath.