Skip to content

Latest commit

 

History

History

slf4j-simple

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

slf4j-simple

A simple logging setup using SLF4J's slf4j-simple logging implementation.

Instructions

Follow these instructions to build and run the example program:

  1. Pre-requisite: Java 21
  2. Build the program distribution
    • ./gradlew installDist
  3. Run the program
    • build/install/slf4j-simple/bin/slf4j-simple
    • It will output something like the following.
    • 19:27:10 [main] WARN dgroomes.slf4j_simple.Main - A WARN-level message
      19:27:10 [main] ERROR dgroomes.slf4j_simple.Main - An ERROR-level message
      
    • Notice how the code specified TRACE, DEBUG and INFO level messages but only WARN and ERROR messages were logged. Study the logging configuration file src/main/resources/simplelogger.properties to see why.

Notes

How do you debug SLF4J itself? There must be a way to turn on debug or trace logs withing SLF4J's initialization phase...