// handler configured to Level.FINEST - both log messages displayed
logger.info("INFO level log message");
logger.finest("FINEST level log message");
}
}
package test;
import java.util.logging.Logger;
public class LoggingTestClass {
private static Logger logger = Logger.getLogger("test.LoggingTestClass");
public static void main(String[] args) {
// expecting to see BOTH log messages displayed because of config in LoggingConfigClass
// only INFO log message gets displayed...why is this?
logger.info("INFO level log message");
logger.finest("FINEST level log message");
}
}
The LoggingConfigClass, as the name suggests, configures a logger and displays two messages. This class works as I anticipated.
The LoggingTestClass has a logger, which has no explicit configuration. I want to take advantage of the logger hierarchy (it should behave in the same way as the logger in LoggingConfig class). This does not happen despite the fact that I have been careful about how I named the logger in each class (which I think is the deciding factor in using logging hieriarchy???).
Could somebody please point out where I have gone wrong...?