I am using Lombok's @Slf4j
annotation to get a org.slf4j.Logger
instance in my Spring Boot classes like so:
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class Blah {
public void blupp() {
log.info("Hi guys.");
}
}
Because I cannot get hold of the log files easily, I want to provide an API in the application that returns "log temperature" i.e. a count of log messages of severity >= ERROR
since last call.
Question: Is there an easy way to extend the Spring Boot / Lombok / Slf4j frameworks with a piece of code that will maintain the map Severity -> Count in memory?