Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for log level independent logging #374

Open
tglaeser opened this issue Dec 8, 2023 · 0 comments
Open

Add support for log level independent logging #374

tglaeser opened this issue Dec 8, 2023 · 0 comments

Comments

@tglaeser
Copy link

tglaeser commented Dec 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant