Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.util.logging.Logger doesn't respect java.util.logging.Level?

Tags:

java

logging

In plain Java SE 6 environment:

Logger l = Logger.getLogger("nameless"); l.setLevel(Level.ALL); l.fine("somemessage"); 

Nothing shows up in Eclipse console. l.info("") and above works just fine, but anything below fine just doesn't seem to work. What's could be wrong? TIA.

like image 735
yanchenko Avatar asked Jan 22 '09 19:01

yanchenko


People also ask

How do I change the logging level in Java?

Java Util Logging - Log Levels To change a log level we must use Logger#setLevel() and Handler#setLevel() .

What is Java Util logging level?

Description. java.util.logging. Provides the classes and interfaces of the JavaTM 2 platform's core logging facilities. javax.sql.rowset.spi. The standard classes and interfaces that a third party vendor has to use in its implementation of a synchronization provider.

How do I disable Java Util logging?

For a global impact you can use LogManager. reset() as your call to disable logging and to re-enable logging you can LogManager. readConfiguration() .


1 Answers

Even though the Logger level is set to ALL, the ConsoleHandler (the default Handler on the logger) still has a default level of INFO. This comes from the default logging.properties in JAVA_HOME/jre/lib

like image 141
Kevin Avatar answered Sep 19 '22 13:09

Kevin