Skip to content

Commit 5c206c2

Browse files
committed
spring-projectsgh-4873: configurable Document.toJson() serialization for logging
1 parent f13d826 commit 5c206c2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ protected void executeQuery(Query query, String collectionName, DocumentCallback
569569

570570
if (LOGGER.isDebugEnabled()) {
571571
LOGGER.debug(String.format("Executing query: %s fields: %s sort: %s in collection: %s",
572+
// TBD: move serializeToJsonSafely() to "XXXDelegate" class and make this class a spring managed bean for user customization
572573
serializeToJsonSafely(queryObject), fieldsObject, serializeToJsonSafely(sortObject), collectionName));
573574
}
574575

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/SerializationUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ private static void toFlatMap(String currentPath, Object source, Map<String, Obj
110110
* @param value
111111
* @return the serialized value or {@literal null}.
112112
*/
113+
// TBD: add serializeToJsonSafely(@Nullable Document document, JsonWriterSettings settings) {}
113114
@Nullable
114115
public static String serializeToJsonSafely(@Nullable Object value) {
115116

0 commit comments

Comments
 (0)