Thursday, March 3, 2016

Java Log4j

**** This example is to illustrate how to use log4j ****

Following are the levels of log4j
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
  • FATAL
  • ALL
log4j.properties has mainly three components 
1. Root Logger
2. Appender and 
3. Layout 

a smple log4j.properties file

log4j.rootLogger=INFO,stdout,file // here I am defining the root logger debug level as INFO and out put will be at file and console

log4j.appender.stdout

log4j.appender.file



No comments:

Post a Comment