-
-
Notifications
You must be signed in to change notification settings - Fork 172
4 Interop
tools.logging can use Timbre as its logging implementation (backend). This'll let tools.logging calls trigger Timbre logging calls.
To do this:
- Ensure that you have the tools.logging dependency, and
- Require the
taoensso.timbre.tools.logging
namespace - Call
taoensso.timbre.tools.logging/use-timbre
SLF4Jv2 can use Timbre as its logging backend. This'll let SLF4J logging calls trigger Timbre logging calls.
To do this:
- Ensure that you have the SLF4J dependency ( v2+ only), and
- Ensure that you have the Timbre SLF4J backend dependency
When com.taoensso/timbre-slf4j
(2) is on your classpath AND no other SLF4J backends are, SLF4J will automatically direct all its logging calls to Timbre.
Timbre needs SLF4J API version 2 or newer. If you're seeing
Failed to load class "org.slf4j.impl.StaticLoggerBinder"
it could be that your project is importing the older v1 API, check withlein deps :tree
or equivalent.
For other (non-SLF4J) logging like Log4j, java.util.logging (JUL), and Apache Commons Logging (JCL), use an appropriate SLF4J bridge and the normal SLF4J config as above.
In this case logging will be forwarded:
- From Log4j/JUL/JCL/etc. to SLF4J, and
- From SLF4J to Timbre