如何记录在hibernate中插入和更新查询的响应时间 [英] How to log the response time for insert and update query in hibernate

查看:83
本文介绍了如何记录在hibernate中插入和更新查询的响应时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是hibernate版本5.0.1。我启用了hibernate.generate.statistics = true和log4j.logger.org.hibernate.stat = debug。统计信息仅针对select查询生成。我需要统计信息插入和更新查询。

I am using the hibernate version 5.0.1.I have enabled hibernate.generate.statistics=true and log4j.logger.org.hibernate.stat=debug.The statistics is generated for select query alone.I need the statistics for insert and update query as well.

截至目前,我们正在记录插入和更新查询执行前后的时间差。

As of now we are logging the time difference between the before and after execution time for insert and update queries.

请帮我澄清一下。

推荐答案

请看下面的链接,这可能会帮助你关于Hibernate配置来激活Hibernate性能日志记录。

Please have a look in below link, this might help you regarding hibernate configuration to activate hibernate performance logging.

激活Hibernate统计分析性能

这篇关于如何记录在hibernate中插入和更新查询的响应时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆