Csar Logging Registration (Clogr) simplifies SLF4J logger access while providing compartmentalized logging configurations via Csar.
Include the appropriate Clogr dependency from Maven. To support Logback, for example, simply add
io.clogr:clogr-logback:x.x.x to your POM which transitively brings in the Logback and SLF4J dependencies as wel. If you merely wish easy logger access, instead add
io.clogr:clogr:x.x.x and configure your SLF4J dependencies as you normally would.
Cloggedto bring quick and easy logger access to any class.
Acquire an SLF4J
Logger instance via
Clogged—the same logger you would get from a
LoggerFactory.getLogger(getClass()), but easier and with the ability to compartmentalize logging configurations.
Using Csar (included) you can have the same code running in different threads use different loggers! Clogr's Logback extensions even allow legacy code using
LoggerFactory.getLogger(getClass()) to retrieve the correct logger! (Static loggers will not be affected.) The following example assumes you have included the