Class LogbackMetrics
java.lang.Object
io.micrometer.core.instrument.binder.logging.LogbackMetrics
- All Implemented Interfaces:
MeterBinder
,java.lang.AutoCloseable
@NonNullApi @NonNullFields public class LogbackMetrics extends java.lang.Object implements MeterBinder, java.lang.AutoCloseable
-
Constructor Summary
Constructors Constructor Description LogbackMetrics()
LogbackMetrics(java.lang.Iterable<Tag> tags)
LogbackMetrics(java.lang.Iterable<Tag> tags, ch.qos.logback.classic.LoggerContext context)
-
Method Summary
Modifier and Type Method Description void
bindTo(MeterRegistry registry)
void
close()
static void
ignoreMetrics(java.lang.Runnable r)
Used byCounter.increment()
implementations that may cause a logback logging event to occur.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
LogbackMetrics
public LogbackMetrics() -
LogbackMetrics
-
LogbackMetrics
-
-
Method Details
-
bindTo
- Specified by:
bindTo
in interfaceMeterBinder
-
ignoreMetrics
public static void ignoreMetrics(java.lang.Runnable r)Used byCounter.increment()
implementations that may cause a logback logging event to occur. Attempting to instrument that implementation would cause aStackOverflowError
.- Parameters:
r
- Don't record metrics on logging statements that occur inside of this runnable.
-
close
public void close()- Specified by:
close
in interfacejava.lang.AutoCloseable
-