Skip to content

update log level to debug#2296

Closed
GertDE wants to merge 1 commit intobrettwooldridge:devfrom
GertDE:dev
Closed

update log level to debug#2296
GertDE wants to merge 1 commit intobrettwooldridge:devfrom
GertDE:dev

Conversation

@GertDE
Copy link

@GertDE GertDE commented Feb 24, 2025

This prevents unnecessary log spam in production environments.

This prevents unnecessary log spam in production environments.
@brettwooldridge
Copy link
Owner

@GertDE Hmmmm, why is this happening in production? This is definitely not "expected" behaviour from the perspective of the pool.

@GertDE
Copy link
Author

GertDE commented Mar 21, 2025

@brettwooldridge I'm using Spring and catching QueryTimeoutException (query is interrupted after 1 second) in my application, but HikariCP still logs a warning, so i can`t grep for real exceptions.

@brettwooldridge
Copy link
Owner

@GertDE What about this solution?

@GertDE
Copy link
Author

GertDE commented Apr 11, 2025

@brettwooldridge I've addressed this locally by raising the logging level to ERROR:
logging.level.com.zaxxer.hikari.pool.ProxyConnection=ERROR
In general, I consider it bad practice to log exceptions that aren't actually thrown, as it creates noise in the logs and makes real issues harder to identify. Could you share the reasoning behind logging an exception in this case? Wouldn't the DEBUG level be more appropriate for analytical purposes?

@brettwooldridge
Copy link
Owner

@GertDE It is best practice that exceptions that are eaten must be logged.

https://javanexus.com/blog/handling-swallowed-exceptions-java-guide

@GertDE
Copy link
Author

GertDE commented Apr 13, 2025

Yes, that's correct, but you're handling the exception and rethrowing it, so it's not a swallowed exception.

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 this pull request may close these issues.

2 participants