spring-projects / spring-data-mongodb

Provides support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-mongodb/
Apache License 2.0
1.62k stars 1.08k forks source link

Missing logs on mongoTemplate class #4755

Open rrin8 opened 3 months ago

rrin8 commented 3 months ago

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

mp911de commented 3 months ago

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.

marcingrzejszczak commented 1 month ago

I've done some analysis of that class and logging and this is what we currently have (below list of method names)

No logging

With logging

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).