Saturday, January 15, 2011

Adding log4j


Log4j has advantage over other logging methods like java logger … It has several categories based on which user can set level so that he can restrict the logging of other details … The various levels are

fatal , error , warning , info , ..etc

This is the syntax to declare the logger

private static final Logger logger = Logger.getLogger(Class_name.class.getName());
Inorder to log the errors , info ..etc we use the following syntax

logger.info("");
logger.debug(" ");
logger.error(errorObject);

No comments:

Post a Comment

Please Give Your Comments!!!