|
@@ -1,6 +1,5 @@
|
|
|
package com.elab.mongodb.chain;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.elab.core.componts.chains.ComponentConsumerHandlerChain;
|
|
|
import com.elab.core.componts.chains.ComponentSupplierHandlerChain;
|
|
|
import com.elab.log.utils.CatCrossProcess;
|
|
@@ -54,7 +53,7 @@ public class CatMongoInterceptInvoke implements MongoInterceptInvoke {
|
|
|
try {
|
|
|
String type = String.format("%s - %s", collectionName, MongoActionOperation.INSERT.name());
|
|
|
CatCrossProcess.processTransactionMsg("mongodb", type, (t) -> {
|
|
|
- logger.info("请求入参: " + JSON.toJSONString(objectToSave));
|
|
|
+ logger.info("请求入参: " + LogUtils.getSmallJsonString(objectToSave));
|
|
|
chain.run(request, MongoInterceptInvoke::insert);
|
|
|
return null;
|
|
|
});
|
|
@@ -76,7 +75,7 @@ public class CatMongoInterceptInvoke implements MongoInterceptInvoke {
|
|
|
logger.debug(" query : {}", getString(query));
|
|
|
logger.debug(" update : {} ", getString(update));
|
|
|
T executor = chain.executor(request, MongoInterceptInvoke::update);
|
|
|
- logger.info("mongo result : {}", LogUtils.getJsonString(executor));
|
|
|
+ logger.info("mongo result : {}", LogUtils.getSmallJsonString(executor));
|
|
|
return executor;
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
@@ -121,7 +120,7 @@ public class CatMongoInterceptInvoke implements MongoInterceptInvoke {
|
|
|
logger.debug(" query : {}", getString(query));
|
|
|
logger.debug(" field : {} ", getString(fields));
|
|
|
T executor = chain.executor(request, MongoInterceptInvoke::queryOne);
|
|
|
- logger.info("mongo result : {}", LogUtils.getJsonString(executor));
|
|
|
+ logger.info("mongo result : {}", LogUtils.getSmallJsonString(executor));
|
|
|
return executor;
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
@@ -131,10 +130,7 @@ public class CatMongoInterceptInvoke implements MongoInterceptInvoke {
|
|
|
}
|
|
|
|
|
|
private String getString(Object obj) {
|
|
|
- if (obj == null) {
|
|
|
- return "";
|
|
|
- }
|
|
|
- return obj.toString();
|
|
|
+ return LogUtils.getSmallJsonString(obj);
|
|
|
}
|
|
|
|
|
|
}
|