Browse Source

DATAMONGO-1397 - Log command, entity and collection name in MongoTemplate.geoNear(…).

Original pull request: #348.
pull/663/head
Mark Paluch 10 years ago committed by Oliver Gierke
parent
commit
de0feed565
  1. 8
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 the original author or authors.
* Copyright 2010-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -137,6 +137,7 @@ import com.mongodb.util.JSONParseException; @@ -137,6 +137,7 @@ import com.mongodb.util.JSONParseException;
* @author Chuong Ngo
* @author Christoph Strobl
* @author Doménique Tilleuil
* @author Mark Paluch
*/
@SuppressWarnings("deprecation")
public class MongoTemplate implements MongoOperations, ApplicationContextAware {
@ -640,6 +641,11 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware { @@ -640,6 +641,11 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware {
command.put("query", queryMapper.getMappedObject(query, getPersistentEntity(entityClass)));
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(String.format("Executing geoNear using: %s for class: %s in collection: %s",
serializeToJsonSafely(command), entityClass, collectionName));
}
CommandResult commandResult = executeCommand(command, this.readPreference);
List<Object> results = (List<Object>) commandResult.get("results");
results = results == null ? Collections.emptyList() : results;

Loading…
Cancel
Save