Skip to content

Instantly share code, notes, and snippets.

@umjammer
Last active March 20, 2024 20:23
Show Gist options
  • Save umjammer/58ae4c24299eb4429a95f79dc10a5017 to your computer and use it in GitHub Desktop.
Save umjammer/58ae4c24299eb4429a95f79dc10a5017 to your computer and use it in GitHub Desktop.
[java] logging hell

Logging Hell

types

  • thin wrapper ... apache-commons-logging, slf4j
  • implementation ... log4j, logback, jul, ...

🧅 thin wrapper

apache-commons-logging 1.2

  • 1st search log4j (w/o configuration - classpath:commons-logging.properties)
  • else use jul
  • else use simple

slf4j 1.7.36

  • slf4j-api (no configuration)
  • search backend one of (log4j,jdk14,...,simple)
  • else Failed to Load Class org.slf4j.impl.StaticLoggerBinder

System.Logger

  • from java9 (wtf i didn't know that until now)

🍐 implementation

apache-commons-logging

  • w/o backend -> jul

slf4j

  • slf4j-jdk14 -> jul

logback

log4j2

java.util.logging

  • i choose this bacause no concern about product suspension
  • don't ask me "why you don't use facade?", logging is not important thing for me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment