While trying to execute the following lines only the last two statements are displayed(\"Here is some ERROR\" and \"Here is some FATAL\") and the first three statements are
This is probably happening because your log4j configuration is set to ERROR
. Look for a log4j.properties file with contents like the following:
log4j.rootLogger=ERROR, CONSOLE
# console logging
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=DEBUG
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p %-20.20t %-24c{1}: %m%n
The rootLogger
is set to ERROR
level here using a CONSOLE
appender.
Note that some appenders like the console appender also have a Threshold
property that can be used to overrule the rootLoggers
level. You need to check both in this case.