Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get logging info for HikariCP

Tags:

hikaricp

Using Hibernate 4.3.1, Hikari 2.3.2.

I have configured this in the hibernate persistence xml

...
<property name="hibernate.hikari.leakDetectionThreshold" value="3000" />
<property name="hibernate.hikari.poolName" value="KikariTest" />
<property name="hibernate.hikari.registerMbeans" value="true" />

And this in my log4j.properties

log4j.logger.com.zaxxer.hikari=DEBUG
log4j.additivity.com.zaxxer.hikari=false

Im not seeing any logging information printed. Any ideas?

like image 320
user2046211 Avatar asked Feb 24 '15 13:02

user2046211


People also ask

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 leak detection threshold HikariCP?

From Hikari documentation: "This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. A value of 0 means leak detection is disabled. Lowest acceptable value for enabling leak detection is 2000 (2 seconds).

What is HikariCP DataSource?

Overview. Hikari is a JDBC DataSource implementation that provides a connection pooling mechanism. Compared to other implementations, it promises to be lightweight and better performing.


1 Answers

It took me a whole day to get this right! Turns out I was using log4j libs only, whereas a needed to include the slf4j libs.

like image 136
user2046211 Avatar answered Oct 14 '22 02:10

user2046211