Logging using Log 4j

Logging using Log 4j 


Adding dependency in the pom file.

 <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>


Add the log4j.properties file in the src/main/resources folder.


The following config in the log4j.properties file specifies the path of the log file  log4j.appender.file.File=/home/priyanka/awsS3/logs/info.log 

Build the application and run.
You should be able to see the logs in the path specified.


Comments