加入参数控制json超过一定长度不打印

This commit is contained in:
wangxin
2019-06-28 16:01:44 +08:00
parent 0edcf7162f
commit 2155998f13
5 changed files with 27 additions and 9 deletions

View File

@@ -1924,7 +1924,7 @@ public abstract class BaseService {
maatBean.setOpAction(Constants.INSERT_ACTION);
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
if(json.length()>Constants.JSON_PRINT_LENTH) {
logger.info("APP主题网站配置下发配置参数" + configCompileList.size());
}else {
logger.info("APP主题网站配置下发配置参数" + json);
@@ -1988,7 +1988,7 @@ public abstract class BaseService {
maatBean.setOpAction(Constants.INSERT_ACTION);
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
if(json.length()>Constants.JSON_PRINT_LENTH) {
logger.info("APP Feature增强字符串配置下发配置条数" + configCompileList.size());
}else {
logger.info("APP Feature增强字符串配置下发配置参数" + json);
@@ -2401,7 +2401,7 @@ public abstract class BaseService {
maatBean.setOpAction(Constants.INSERT_ACTION);
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
if(json.length()>Constants.JSON_PRINT_LENTH) {
logger.info("APP策略 配置下发配置条数:" + configCompileList.size());
}else {
logger.info("APP策略 配置下发配置参数:" + json);
@@ -2609,7 +2609,7 @@ public abstract class BaseService {
start=System.currentTimeMillis();
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
if(json.length()>Constants.JSON_PRINT_LENTH) {
logger.info("IP 配置下发配置条数:" + configCompileList.size());
}else {
logger.info("IP 配置下发配置参数:" + json);
@@ -2756,7 +2756,7 @@ public abstract class BaseService {
start=System.currentTimeMillis();
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
if(json.length()>Constants.JSON_PRINT_LENTH) {
logger.info("字符串配置下发配置条数:" + configCompileList.size());
}else {
logger.info("字符串配置下发配置参数:" + json);
@@ -2886,7 +2886,7 @@ public abstract class BaseService {
maatBean.setOpAction(Constants.INSERT_ACTION);
// 调用服务接口下发配置数据
String json = BaseService.gsonToJson(maatBean);
if(configCompileList.size()>10) {
if(json.length()>Constants.JSON_PRINT_LENTH) {
logger.info("增强字符串配置下发配置条数:" + configCompileList.size());
}else {
logger.info("增强字符串配置下发配置参数:" + json);

View File

@@ -455,7 +455,11 @@ public class ObjectGroupService extends BaseService {
maatBean.setOpAction(opAction);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("策略对象组下发配置参数:"+json);
if(json.length()<Constants.JSON_PRINT_LENTH){
logger.info("策略对象组下发配置参数:"+json);
}else{
logger.info("策略对象组下发配置内容超过"+Constants.JSON_PRINT_LENTH+",不打印");
}
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("策略对象组下发响应信息:"+result.getMsg());
@@ -472,7 +476,11 @@ public class ObjectGroupService extends BaseService {
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("策略对象组下发配置参数:"+json);
if(json.length()<Constants.JSON_PRINT_LENTH){
logger.info("策略对象组下发配置参数:"+json);
}else{
logger.info("策略对象组下发配置内容超过"+Constants.JSON_PRINT_LENTH+",不打印");
}
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("策略对象组取消配置响应信息:"+result.getMsg());