如何记录 Spring Data MongoDB 执行的查询? [英] How to log the queries executed by Spring Data MongoDB?
本文介绍了如何记录 Spring Data MongoDB 执行的查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在spring data mongodb中找到针对数据库运行的查询?
Is there a way to find the query that was run against the database in spring data mongodb?
我知道在 JPA 的情况下这是可能的.所以只是想知道 Spring data MongoDB 中是否有类似的东西?
I know this is possible in case of JPA. So was just wondering if there was something similar in Spring data MongoDB?
推荐答案
最简单的方法是将 org.springframework.data.mongodb
的日志级别设置为 DEBUG
.
The easiest way is to set the log level to DEBUG
for org.springframework.data.mongodb
.
这篇关于如何记录 Spring Data MongoDB 执行的查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文