Tuesday, 6 December 2016

Log4j - How to disable all log details




We can logging the step by step activity during automation. If any instance we want to disable all log details then follow the below steps


1) go to the //log/log4j.properties file

2) And set the log4j.rootLogger=OFF


log4j.rootLogger=OFF


we can set the restriction to display the log messages



1) If log4j.rootLogger= DEBUG

then it display the all level

log.debug(),log.info(), log.warn(),  log.error(), log.fatal();


2)  If log4j.rootLogger= INFO

then it will display

log.info(), log.warn(),  log.error(), log.fatal();


3)  If log4j.rootLogger= WARN

then it will display

log.warn(),  log.error(), log.fatal();


4)  If log4j.rootLogger= WARN

then it will display

log.warn(),  log.error(), log.fatal();


5)  If log4j.rootLogger= ERROR

then it will display

log.error(), log.fatal();


6)  If log4j.rootLogger= FATAL

then it will display

log.fatal();


7)  If log4j.rootLogger= OFF

then it will NOT display



http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/log4j/log4j.html#LOG4J-Basics-Logger


No comments:

Post a Comment