It’s quite straightforward to integrate Log4j into the Spring MVC application. First, include Log4j.jar library into your project dependency, then create a log4.properties file to define the Log4j’s appender and put this file into the project classpath, Done.
In the tutorial, we show you how to integrate the Log4j 1.x logging framework into the Spring MVC application.
Add Log4j Library to Your Project Download the Log4j library from the official website, or via Maven :