Mar 25th, 2011, 12:19 PM
How to Log Query String for Mongo
I'm trying to see why my query is returning no results... and would like to see the exact query executed. I tried to get this to log by adding
to my log4j.properties i get SOME extra logging but not the query.
Is there a way to list the query that is being executed?
Mar 29th, 2011, 01:44 PM
Do you refer to the repositories? Actually, MongoQueryCreator logs the query it creates into DEBUG level. If you'd like to see more logging output inside MongoTemplate feel free to open a JIRA.
Apr 6th, 2011, 07:40 PM
I just added some debug logging to the MongoTemplate's find methods. So if you enable DEBUG for org.springframework.data.document.mongodb you should see the query being used.
Apr 7th, 2011, 03:23 PM
Thanks, that helps a lot. I can see the template queries now. -D
Tags for this Thread