Besides ordinary/journal logging there are other logging needs like audit, trace, and metrics logging. Those other types of logging have all in common that the log message shall be published independently of a logging level.
Log4J2 supports such use cases by invoking org.apache.logging.log4j.spi.ExtendedLogger#logIfEnabled with level set to org.apache.logging.log4j.Level#OFF.
How would SLF4J support such use cases? It would be nice to have a method like org.slf4j.Logger#atOff#log(org.slf4j.Marker, java.lang.String) or org.slf4j.Logger#log(org.slf4j.Marker, java.lang.String) with a corresponding binding to Log4J2 that always publishes a log message independently of the log level.
Without such, the above mentioned use cases cannot elegantly implemented using this facade.
Besides ordinary/journal logging there are other logging needs like audit, trace, and metrics logging. Those other types of logging have all in common that the log message shall be published independently of a logging level.
Log4J2
supports such use cases by invokingorg.apache.logging.log4j.spi.ExtendedLogger#logIfEnabled
withlevel
set toorg.apache.logging.log4j.Level#OFF
.How would
SLF4J
support such use cases? It would be nice to have a method likeorg.slf4j.Logger#atOff#log(org.slf4j.Marker, java.lang.String)
ororg.slf4j.Logger#log(org.slf4j.Marker, java.lang.String)
with a corresponding binding toLog4J2
that always publishes a log message independently of the log level.Without such, the above mentioned use cases cannot elegantly implemented using this facade.