How to change HikariCP logging time?

Viewed 1063

I am working on a Spring Boot project and I can see connection pool details thanks to below codes:

logging.level.com.zaxxer.hikari.HikariConfig=DEBUG
logging.level.com.zaxxer.hikari=TRACE

Also, here is my HikariCP configuration codes:

spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.idleTimeout=600000
spring.datasource.hikari.maxLifetime=1800000
spring.datasource.hikari.maximumPoolSize=10

HikariCP housekeeper logs each 30 second. I want to increase this logging time.(2 min,5 min etc.) Does anyone know how I can do this? Thanks your answers.

1 Answers

When you look in the com.zaxxer.hikari.pool.HikariPool class you'll find a housekeeper task that runs every 30s and does the logging. It seems to be undocumented and it would affect more than just logging, but you can change how often it runs with the system property com.zaxxer.hikari.housekeeping.periodMs, e.g. -Dcom.zaxxer.hikari.housekeeping.periodMs=10000 to run every 10s.

Related