Skip to content
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

Active health check logs on every check instead of state change #6415

Closed
klaxa opened this issue Jun 21, 2024 · 1 comment · Fixed by #6419
Closed

Active health check logs on every check instead of state change #6415

klaxa opened this issue Jun 21, 2024 · 1 comment · Fixed by #6419

Comments

@klaxa
Copy link
Contributor

klaxa commented Jun 21, 2024

Hello, first of all thanks for caddy, I enjoy using it!

I recently updated from 2.7.6 to 2.8.4, because I required the behavior of not following HTTP redirects on active health checks and noticed that, as opposed to 2.7.6, the newer version logs the host status on every active check when the host is up instead of only when the state changes from down to up.

I investigated the source and found that the logic was changed between the versions. In 2.7.6 the log was written when the event was emitted (https://github.com/caddyserver/caddy/blob/v2.7.6/modules/caddyhttp/reverseproxy/healthchecks.go#L443) while in 2.8.4 the emitting of the event was refactored into markHealthy() with the logging being moved to a higher level (https://github.com/caddyserver/caddy/blob/v2.8.4/modules/caddyhttp/reverseproxy/healthchecks.go#L495)

I am not sure this is the intended behavior as it fills the log quickly with identical messages (except for the timestamp of course).

I think the simplest solution would be to move the logging of "host is up" (L495) into markHealthy() (after L428) because it checks for the previous state before emitting the event.

Thank you and best regards!

@klaxa
Copy link
Contributor Author

klaxa commented Jun 30, 2024

Ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant