-
-
Notifications
You must be signed in to change notification settings - Fork 5
3 Config
See below for config by topic-
A signal will be provided to a handler iff ALL of the following are true:
- Signal creation is allowed by compile-time "signal filters"
- Signal creation is allowed by runtime "signal filters"
- Signal handling is allowed by runtime "handler filters"
- Signal middleware does not suppress the signal (return nil)
- Handler middleware does not suppress the signal (return nil)
All filters (1-3) may depend on (in order):
Sample rate → namespace → kind → id → level → when form/fn → rate limit
See help:filters
for more about filtering.
See section 4-Handlers.
clojure.tools.logging
can use Telemere as its logging implementation.
To do this:
- Ensure that you have the
clojure.tools.logging
dependency, and - Call
tools-logging->telemere!
, or set the relevant environmental config as described in its docstring.
Verify successful intake with check-intakes
:
(check-intakes) ; =>
{:tools-logging {:sending->telemere? true, :telemere-receiving? true}}
SLF4J
can use Telemere as its logging backend.
To do this, ensure that you have the following dependencies:
[org.slf4j/slf4j-api "x.y.z"] ; >= 2.0.0
[com.taoensso/slf4j-telemere "x.y.z"]
When com.taoensso/slf4j-telemere
is on your classpath AND no other SLF4J backends are, SLF4J will direct all its logging calls to Telemere.
Verify successful intake with check-intakes
:
(check-intakes) ; =>
{:slf4j {:sending->telemere? true, :telemere-receiving? true}}
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 Telemere
The JVM's System/out
and/or System/err
streams can be set to flush to Telemere signals.
To do this, call streams->telemere!
.
Note that Clojure's *out*
, *err*
are not necessarily automatically affected.
Verify successful intake with check-intakes
:
(check-intakes) ; =>
{:system/out {:sending->telemere? true, :telemere-receiving? true}
:system/err {:sending->telemere? true, :telemere-receiving? true}}
Telemere can send signals as LogRecords
to OpenTelemetry.
To do this:
- Ensure that you have the OpenTelemetry Java dependency.
- Use
handler:open-telemetry-logger
to create an appropriately configured handler, and register it withadd-handler!
.
Tufte is a simple performance monitoring library for Clojure/Script by the author of Telemere.
Telemere can easily incorporate Tufte performance data in its signals, just like any other data:
(let [[_ perf-data] (tufte/profiled <opts> <form>)]
(t/log! "Performance data" {:perf-data perf-data}))
Telemere and Tufte work great together:
- Their functionality is complementary.
- The upcoming Tufte v4 will share the same core as Telemere and offer an identical API for managing filters and handlers.
Truss is an assertions micro-library for Clojure/Script by the author of Telemere.
Telemere can easily incorporate Truss assertion failure information in its signals, just like any other (error) data.
The catch->error!
signal creator can be particularly convenient for this:
(t/catch->error! <form-with-truss-assertion/s>)