I am writing a SpringBoot 3 application which needs to report metrics inside log files too.
I registered an instance of io.micrometer.core.instrument.logging.LoggingMeterRegistry
by:
@Bean
LoggingMeterRegistry loggingMeterRegistry() {
return new LoggingMeterRegistry();
}
It works as expected, but:
- I don't know how to provide configuration settings (like the
step
) by theapplication.yaml
file. - I don't know how to register a custom instance of the class
com.codahale.metrics.MetricFilter
to filter the output.
Could somebody tell me how to achieve these goals?
Thank you so much in advance!
Edit: my issue seems similar to How to configure LoggingMeterRegistry step duration in Spring Boot 2.x? .