-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude health check probes from access logs #48
Comments
Hello! Logback access filters are designed to solve this problem. Can you more clearly explain your use case with janino? I'm a little puzzled, because logback also uses janino for filters: <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator name="EvalActuator">
<expression>
!((event.getStatusCode() == 200) && (event.getRequestURI().startsWith("/actuator"))
</expression>
</evaluator>
<onMismatch>DENY</onMismatch>
</filter> |
actuators context is customizable... I think it would be much better to use a custom spring boot property, something like spring.logging.access.exclude-url-patterns |
Another way to configure the <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator class="ch.qos.logback.access.net.URLEvaluator">
<URL>/health</URL>
<!-- add more URLs as needed -->
</evaluator>
<OnMismatch>NEUTRAL</OnMismatch>
<OnMatch>DENY</OnMatch>
</filter>
|
Hi @fiunchinho |
Hi!
It's common to have a load balancer or container orchestration system probing that your application is ready to serve traffic. At the moment, I'm using Janino to exclude those access logs from appearing, but I believe it's such a common issue that it would be helpful to provide a Spring property to enable/disable excluding the health check access logs.
The request uri to be excluded would be the actuator health endpoint, and only when the response is 200 OK. That way, if something goes wrong, you still see the errors. But you no longer get an infinite log full of GET /health 200 OK.
I'd be happy to contribute, but I don't know how that can be done in this library.
The text was updated successfully, but these errors were encountered: