spring-projects / spring-projects/spring-data-mongodb

Missing logs on mongoTemplate class

Open
#4,755 3 comments 0 reactions 0 assignees View on GitHub

@marcingrzejszczak is already working on this.

Since Sep 12, 2024.

  • #4782 by @marcingrzejszczak — open
status: ideal-for-contribution theme: logging type: enhancement
Dominant language
Java
Stars
1.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review linked pull request #4782 first, then inspect org.springframework.data.mongodb.core.MongoTemplate, especially doStream and doFind, and compare their debug output with doFindAndModify. Done means the relevant MongoDB operation logs consistently include the executed query and sorting information where applicable, with the associated tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mongodb, spring
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.