hibernate的统计信息
2021-09-15 10:33:41.574 INFO 4908 --- [ restartedMain] i.StatisticalLoggingSessionEventListener : Session Metrics {
0 nanoseconds spent acquiring 0 JDBC connections;
0 nanoseconds spent releasing 0 JDBC connections;
0 nanoseconds spent preparing 0 JDBC statements;
0 nanoseconds spent executing 0 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
0 nanoseconds spent performing 0 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
}
原来
<prop key="hibernate.generate_statistics">true</prop>
提供了hibernate.generate_statistics属性,该属性提供了Hibernate应用中操作的统计信息,必须在hibernate.cfg.xml文件中进行配置。该属性在配置文件中的默认值是关闭的,因为它会消耗一些资源,但是它很适合在我们开发过程中调试程序时使用。
改为false即可以消息
<prop key="hibernate.generate_statistics">false</prop>