Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logging HikariCP Spring boot

i set my properties in my application.yml

spring.datasource.hikari.connection-timeout: 30000
spring.datasource.hikari.maximum-pool-size: 10
spring.datasource.hikari.idle-timeout: 600000
spring.datasource.hikari.minimum-idle: 10

Spring is 2.1.9.RELEASE

How can i log these parameter to check that the application has taken the configurations correctly?

Thank's

like image 386
resla95 Avatar asked Mar 19 '20 12:03

resla95


People also ask

What is HikariCP spring boot?

HikariCP is a reliable, high-performance JDBC connection pool. It is much faster, lightweight and have better performance as compare to other connection pool API. Because of all these compelling reasons, HikariCP is now the default pool implementation in Spring Boot 2.

How do I check Hikari connection pool?

You can open MYSQL console and query by typing this query. as an example, I have added 10 connections for the pool. the username of the connection is mafei_connection_test . then you can see the all connection that the MySQL server created and currently opening.

What is HikariCP?

"HikariCP is solid high-performance JDBC connection pool. A connection pool is a cache of database connections maintained so that the connections can be reused when future requests to the database are required.


1 Answers

If you have springboot and you want logging your HikariCP parameters to check that the application has taken the configurations correctly put this in your application.yaml or application.properties

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

Console will show you all

like image 107
resla95 Avatar answered Sep 22 '22 11:09

resla95