io.pedestal.log
Logging via slf4j. Each logging level is a macro: trace, debug,
info, warn, and error. Each namespace gets its own Logger. Arguments
are key-value pairs, which will be printed as with 'pr'. The special
key :exception should have a java.lang.Throwable as its value, and
will be passed separately to the underlying logging API.
One can override the logger via JVM or ENVAR settings.
counter
(counter metric-name delta)
(counter recorder metric-name delta)
debug
macro
(debug & keyvals)
default-recorder
This is the default recorder of all metrics.
This value is configured by setting the JVM Property 'io.pedestal.log.defaultMetricsRecorder'
or the environment variable 'PEDESTAL_METRICS_RECORDER'.
The value of the setting should be a namespaced symbol
that resolves to a 0-arity function or nil.
That function should return something that satisfies the MetricRecorder protocol.
If no function is found, metrics will be reported only to JMX via a DropWizard MetricRegistry.
error
macro
(error & keyvals)
gauge
(gauge metric-name value-fn)
(gauge recorder metric-name value-fn)
histogram
(histogram metric-name value)
(histogram recorder metric-name value)
info
macro
(info & keyvals)
jmx-reporter
(jmx-reporter registry)
log-reporter
(log-reporter registry)
LoggerSource
protocol
members
-debug
(-debug t body)
(-debug t body throwable)
Log a DEBUG message,
and optionally handle a special Throwable/Exception related to the message.
The body may be any of Clojure's literal data types, but a map or string is encouraged.
-error
(-error t body)
(-error t body throwable)
Log an ERROR message,
and optionally handle a special Throwable/Exception related to the message.
The body may be any of Clojure's literal data types, but a map or string is encouraged.
-info
(-info t body)
(-info t body throwable)
Log an INFO message,
and optionally handle a special Throwable/Exception related to the message.
The body may be any of Clojure's literal data types, but a map or string is encouraged.
-level-enabled?
(-level-enabled? t level-key)
Given the log level as a keyword,
return a boolean if that log level is currently enabled.
-trace
(-trace t body)
(-trace t body throwable)
Log a TRACE message,
and optionally handle a special Throwable/Exception related to the message.
The body may be any of Clojure's literal data types, but a map or string is encouraged.
-warn
(-warn t body)
(-warn t body throwable)
Log a WARN message,
and optionally handle a special Throwable/Exception related to the message.
The body may be any of Clojure's literal data types, but a map or string is encouraged.
maybe-init-java-util-log
(maybe-init-java-util-log)
Invoke this once when starting your application to redirect all
java.util.logging log messages to SLF4J. The current project's
dependencies must include org.slf4j/jul-to-slf4j.
meter
(meter metric-name)
(meter metric-name n-events)
(meter recorder metric-name n-events)
metric-registry
(metric-registry & reporter-init-fns)
Create a metric-registry.
Optionally pass in single-arg functions, which when passed a registry,
create, start, and return a reporter.
MetricRecorder
protocol
members
-counter
(-counter t metric-name delta)
Update a single Numeric/Long metric by the `delta` amount
-gauge
(-gauge t metric-name value-fn)
Register a single metric value, returned by a 0-arg function;
This function will be called everytime the Guage value is requested.
-histogram
(-histogram t metric-name value)
Measure a distribution of Long values
-meter
(-meter t metric-name n-events)
Measure the rate of a ticking metric - a meter.
spy
macro
(spy expr)
Logs expr and its value at DEBUG level, returns value.
trace
macro
(trace & keyvals)
warn
macro
(warn & keyvals)