Class LogbackMetrics
java.lang.Object
io.micrometer.core.instrument.binder.logging.LogbackMetrics
- All Implemented Interfaces:
MeterBinder,AutoCloseable
Metrics instrumentation of Logback log events. Counts the log events with a log level
equal to or higher than the corresponding logger's effective log level. A filter added
to an appender will not affect the metrics.
-
Constructor Summary
ConstructorsConstructorDescriptionLogbackMetrics(Iterable<Tag> tags) LogbackMetrics(Iterable<Tag> tags, ch.qos.logback.classic.LoggerContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidbindTo(MeterRegistry registry) voidclose()static voidDeprecated.
-
Constructor Details
-
LogbackMetrics
public LogbackMetrics() -
LogbackMetrics
-
LogbackMetrics
-
-
Method Details
-
bindTo
- Specified by:
bindToin interfaceMeterBinder
-
ignoreMetrics
Deprecated.Should not be needed anymore sinceLogbackMetricsrecords logback events asynchronously and should not get into an infinite loop.This method was used byCounter.increment()implementations that may cause a logback logging event to occur. Attempting to instrument that implementation used to cause aStackOverflowError.- Parameters:
r- The runnable to execute, previously it also disabled recording metrics on logging statements that occur inside of this runnable but this is not needed anymore.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
LogbackMetricsrecords logback events asynchronously and should not get into an infinite loop.