Logging Hikari debug information from Tomcat?

1,649 views
Skip to first unread message

Michael Van Kleeck

unread,
Oct 16, 2014, 12:05:07 PM10/16/14
to hika...@googlegroups.com
Hi! I'm working on migrating my client's connection pools from BoneCP to Hikari. BoneCP is locking up our applications every 10 days or so, apparently due to its inability to close stale, unused connections that weren't properly closed. I'm hoping Hikari will give me a stack trace when it closes the idle connections that will point me to the troublesome application code.

The connection pools are set up as server resources in Tomcat's server.xml, and linked in the applications through ResourceLinks. 

The client's Tomcat uses the default Tomcat logging setup (version 6.0.41), using log4j and logging.properties. The Tomcat logging is all default settings, though I've changed all log levels in logging.properties to FINEST. I've migrated the connection pools to Hikari in the server.xml, and I've dropped the slf4j and slf4j-log4j jars into the Tomcat  lib directory. I've also added the "-Dorg.slf4j.simpleLogger.defaultLogLevel=debug" switch to the Tomcat startup.

However, I am not seeing anything at all from Hikari in any of the Tomcat logs or the application logs, and am not seeing any live stats in JConsole. I do see that the datasources are loaded in JConsole, and I know that they are working, but I need to see live information from Hikari about connection stats and need to see what happens when Hidari closes an idle connection.

Can you help me figure out how to see information being logged by Hikari? Thanks!

-Michael

Brett Wooldridge

unread,
Oct 19, 2014, 8:10:23 AM10/19/14
to
Re: logging, you'll need to check the many resources on the net about integrating slf4j into Tomcat's logging.  Re: JConsole, you need to make sure that you set the registerMbeans property to true in your HikariCP configuration, then you should see the HikariCP pool entries in the JMX console.  You can get JConsole to "chart" one or more of the metrics in "realtime" (1 second interval, etc.).
Reply all
Reply to author
Forward
0 new messages