Many answers around with option of .setlevel() option,which isn't working in my case because of the below .
Scenario:
- log4j.xml file under resources is kept with ERROR mode while jetty startup.
Code:
private static Logger logger = Logger.getLogger(test.class);
private static final boolean DEBUG = logger.isDebugEnabled();
if(DEBUG){ //DEBUG will be false as the logging level is set to ERROR
logger.debug("This should print,but it will not print as DEBUG will be set as false during startup");
}
Thanks in advance for your suggestions .