Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to map levels of java.util.logging and SLF4J logger?

How do logging levels from java.util.logging map to SLF4J?

SLF4J

  • trace
  • debug
  • info
  • warn
  • error
  • fatal

java.util.logging

  • finest
  • finer
  • fine
  • config
  • info
  • warning
  • severe
like image 630
shashantrika Avatar asked Dec 27 '13 05:12

shashantrika


People also ask

How do you change the log level in SLF4J?

When using log4j, the Logger. log(Priority p, Object message) method is available and can be used to log a message at a log level determined at runtime. We're using this fact and this tip to redirect stderr to a logger at a specific log level. slf4j doesn't have a generic log() method that I can find.

What is the default logging level in SLF4J?

slf4j. simpleLogger. defaultLogLevel - Default log level for all instances of SimpleLogger. Must be one of ("trace", "debug", "info", "warn", "error" or "off").

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.


1 Answers

From the SLF4JBridgeHandler docs and testing (annotated with brackets):

[ALL    -> TRACE] FINEST  -> TRACE FINER   -> DEBUG FINE    -> DEBUG [CONFIG -> INFO] INFO    -> INFO WARNING -> WARN SEVERE  -> ERROR [OFF    -> ERROR] 
like image 88
jmehrens Avatar answered Sep 21 '22 22:09

jmehrens