spring-data-mongodb
spring-data-mongodb copied to clipboard
Missing logs on mongoTemplate class
Hi,
This is a feedback on the org.springframework.data.mongodb.core.MongoTemplate cass logging.
During some troubleshooting i noticed that in the mongoTemplate class, the doStream method is missing the debug logging of the query executed, the doFind with debug active Instead print the query to be executed.
i also noticed on doFind that the log debug output is missing the sorting parameter (very useful for query optimization) but in other like doFindAndModify there is, maybe the logging is a little inconsistent across the various type of possibile actions.
Is a log check/alignment planned? Thanks, Riccardo
Thanks for reaching out. This is an issue you can help us with if you want to submit a pull request to address the issue.
I've done some analysis of that class and logging and this is what we currently have (below list of method names)
No logging
- stream
- execute
- execute through CollectionCallbacks
- withSession
- geoNear
With logging
- executeQuery
- createCollection (through doCreateCollection)
- findOne
- findDistinct
- findAndModify
- findAndRemove
- findAndReplace
I will go through the whole class and ensure that we log as much debug information as it makes sense for all of the public methods (where it makes sense obviously).