The Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction1 for various logging frameworks (e.g. java.util.logging, logback, log4j) allowing the end user to plug in the desired logging framework at deployment time.
The underlying logging backend is determined at runtime by adding the desired binding to the classpath and may be the standard Sun Java logging package java.util.logging,[2] log4j, logback[3] or tinylog.[4][5]
It is not itself a logging library, but a generic interface to one of many logging libraries.
Remarque : Un bémole, ne permet pas d'utilise le niveau de sévérité FATAL. Mais y a moyen de s'en sortir avec la notion de “Marker” ; For example, any log statement of level ERROR can be tagged with the “FATAL” marker.
Changer le niveau de sévérité :
<sxh java>
((ch.qos.logback.classic.Logger)LoggerFactory.getLogger("abc.xyz")).setLevel(Level.ERROR);
</sxh>
Welcome to Apache log4j, a logging library for Java.
Logback is intended as a successor to the popular log4j project, picking up where log4j leaves off.
Autres remarques : Log4j 2 - Apache Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many of the improvements available in Logback while fixing some inherent problems in Logback's architecture.
Framework standard, embarqué dans les JRE
Les loggers enfant héritent des propriétés (loglevel et appenders) du rootLogger
Un appender défini dans un logger s'ajoute à ou aux appenders déjà définis dans les loggers de la hiérarchie mère.