In my Struts project I am using Loggers. I am running my WSAD server in Debug Mode. Here the below condition is satisfying but it is not printing the log info in console.
if(count.intValue() > 1)
{
if (log.isDebugEnabled())
log.info("many");
return mapping.findForward("many");
}
Here I set my Logger level to INFO.
A “lower” logging level includes all the “higher” levels:
That means for example that when you set the level to DEBUG, you’ll also get INFO, WARN and ERROR messages; if you set it to INFO, you’ll see ERROR, WARN and INFO but not DEBUG messages, etc.
Look at these lines:
What is confusing here is that you test if the DEBUG level is active (with
isDebugEnabled), but you actually log at the INFO level.So, what happens here if the level is set to:
isDebugEnabledreturnsfalsewhen the level is set to anything higher than DEBUG. That means the statement inside theifis not executed and you don’t see the message.