Announcement Announcement Module
Collapse
No announcement yet.
How to Log Query String for Mongo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Log Query String for Mongo

    Hey There,

    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

    log4j.category.org.springframework.data.document=T RACE

    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?

    Thanks!
    Dave

  • #2
    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.

    Regards,
    Ollie

    Comment


    • #3
      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.

      Comment


      • #4
        Thanks..

        Thanks, that helps a lot. I can see the template queries now. -D

        Comment

        Working...
        X