取消spring boot 中控制台打印hibernate的统计信息
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 re
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>
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)