浏览代码

增加业务监控

15810770710@163.com 3 年之前
父节点
当前提交
f7be554534

+ 10 - 0
pom.xml

@@ -21,6 +21,11 @@
     <dependencies>
         <dependency>
             <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
 
@@ -59,6 +64,11 @@
             <artifactId>httpclient</artifactId>
             <version>4.5.6</version>
         </dependency>
+        <dependency>
+            <groupId>com.xuxueli</groupId>
+            <artifactId>xxl-job-core</artifactId>
+            <version>2.1.2</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 4 - 0
src/main/java/com/jkcredit/illegal/info/IllegalInfoApplication.java

@@ -2,8 +2,12 @@ package com.jkcredit.illegal.info;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 @SpringBootApplication
+@EnableScheduling
+@EnableConfigurationProperties
 public class IllegalInfoApplication {
 
     public static void main(String[] args) {

+ 74 - 0
src/main/java/com/jkcredit/illegal/info/config/XxlJobConfig.java

@@ -0,0 +1,74 @@
+package com.jkcredit.illegal.info.config;
+
+import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * xxl-job config
+ *
+ * @author xuxueli 2017-04-28
+ */
+@Configuration
+public class XxlJobConfig {
+    private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
+
+    @Value("${xxl.job.admin.addresses}")
+    private String adminAddresses;
+
+    @Value("${xxl.job.executor.appname}")
+    private String appName;
+
+    @Value("${xxl.job.executor.ip}")
+    private String ip;
+
+    @Value("${xxl.job.executor.port}")
+    private int port;
+
+    @Value("${xxl.job.accessToken}")
+    private String accessToken;
+
+    @Value("${xxl.job.executor.logpath}")
+    private String logPath;
+
+    @Value("${xxl.job.executor.logretentiondays}")
+    private int logRetentionDays;
+
+
+    @Bean
+    public XxlJobSpringExecutor xxlJobExecutor() {
+        logger.info(">>>>>>>>>>> xxl-job config init.");
+        XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
+        xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
+        xxlJobSpringExecutor.setAppName(appName);
+        xxlJobSpringExecutor.setIp(ip);
+        xxlJobSpringExecutor.setPort(port);
+        xxlJobSpringExecutor.setAccessToken(accessToken);
+        xxlJobSpringExecutor.setLogPath(logPath);
+        xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
+
+        return xxlJobSpringExecutor;
+    }
+
+    /**
+     * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
+     *
+     *      1、引入依赖:
+     *          <dependency>
+     *             <groupId>org.springframework.cloud</groupId>
+     *             <artifactId>spring-cloud-commons</artifactId>
+     *             <version>${version}</version>
+     *         </dependency>
+     *
+     *      2、配置文件,或者容器启动变量
+     *          spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
+     *
+     *      3、获取IP
+     *          String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
+     */
+
+
+}

+ 10 - 0
src/main/java/com/jkcredit/illegal/info/constant/CommonConstant.java

@@ -15,4 +15,14 @@ public class CommonConstant {
     public static long TIME_OUT = 5000;
     // contentType-application/json
     public static String MEDIA_TYPE = "application/json;charset=UTF-8";
+    // 不良-人员核验-超时redisKey
+    public static String PERSON_ILLEGAL_INFO_TIME_OUT = "personIllegalInfoTimeOut";
+    // 不良-人员核验-业务异常redisKey
+    public static String PERSON_ILLEGAL_INFO_QUERY_FAILED = "personIllegalInfoQueryFailed";
+    // 不良-车辆核验-超时redisKey
+    public static String VEHICLE_ILLEGAL_INFO_TIME_OUT = "vehicleIllegalInfoTimeOut";
+    // 不良-车辆核验-业务异常redisKey
+    public static String VEHICLE_ILLEGAL_INFO_QUERY_FAILED = "vehicleIllegalInfoQueryFailed";
+
+    public static final String APPLICATION_JSON_UTF8_VALUE = "application/json;charset=UTF-8";
 }

+ 23 - 0
src/main/java/com/jkcredit/illegal/info/model/DingRobotResponseObject.java

@@ -0,0 +1,23 @@
+package com.jkcredit.illegal.info.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/8/18 16:50
+ * @version: V1.0
+ **/
+@Data
+public class DingRobotResponseObject implements Serializable {
+    private static final long serialVersionUID = 4636521915878354881L;
+
+    @JSONField(name = "errcode")
+    private Integer errorCode;
+
+    @JSONField(name = "errmsg")
+    private String errorMsg;
+}

+ 30 - 0
src/main/java/com/jkcredit/illegal/info/model/SendDingMsgResponseObject.java

@@ -0,0 +1,30 @@
+package com.jkcredit.illegal.info.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Data
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+public class SendDingMsgResponseObject {
+    public static Integer SUCCESS = 1;
+    public static Integer FAILED = 2;
+
+    private int code;
+    private String msg;
+
+    public static SendDingMsgResponseObject success(String msg) {
+        return new SendDingMsgResponseObject(SUCCESS, msg);
+    }
+
+    public static SendDingMsgResponseObject failure(String msg) {
+        return new SendDingMsgResponseObject(FAILED, msg);
+    }
+}

+ 13 - 0
src/main/java/com/jkcredit/illegal/info/service/impl/IllegalInfoServiceImpl.java

@@ -2,6 +2,7 @@ package com.jkcredit.illegal.info.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.jkcredit.illegal.info.constant.CommonConstant;
 import com.jkcredit.illegal.info.model.*;
 import com.jkcredit.illegal.info.service.IllegalInfoService;
 import com.jkcredit.illegal.info.util.AesUtil;
@@ -11,7 +12,9 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 
 /**
@@ -29,6 +32,9 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
     private String vehicleIllegalInfoUrl;
     @Value("${illegalInfo.decodeKey}")
     private String decodeKey;
+    @Autowired
+    StringRedisTemplate stringRedisTemplate;
+
     private static final Log CHARGE_LOGGER = LogFactory.getLog("CHARGE_LOGGER");
     @Override
     public IllegalInfoResult checkIllegalInfo(IllegalInfoRequestParam requestParams) {
@@ -39,8 +45,10 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
         log.info("调用上游接口-流水号:{}, 入参:{}, 返回:{}, 时延:{}", requestParams.getTraceId(), body, result, System.currentTimeMillis() - startTime);
         if (StringUtils.isBlank(result)) {
             log.info("调用上游接口-流水号:{}, 入参:{}, 请求上游失败无返回", requestParams.getTraceId(), body);
+            stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_TIME_OUT).increment();
             return null;
         }
+
         IllegalInfoResult illegalInfoResult = JSON.toJavaObject(JSON.parseObject(result), IllegalInfoResult.class);
         // 返回4个参数,code0表示结果正常,其他表示异常
         if (!illegalInfoResult.getCode().equals("0")
@@ -49,6 +57,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
             || illegalInfoResult.getIsPedigree().equals("2")) {
             // 查询错误,不计费
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, false, requestParams.getTraceId())));
+            stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_QUERY_FAILED).increment();
         } else {
             // 查询成功,计费
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, true, requestParams.getTraceId())));
@@ -72,6 +81,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
         log.info("调用上游接口-流水号:{}, 入参:{}, 返回:{}, 时延:{}", requestParam.getTraceId(), body, result, System.currentTimeMillis() - startTime);
         if (StringUtils.isBlank(result)) {
             log.info("调用上游接口-流水号:{}, 入参:{}, 请求上游失败无返回", requestParam.getTraceId(), body);
+            stringRedisTemplate.boundValueOps(CommonConstant.VEHICLE_ILLEGAL_INFO_TIME_OUT).increment();
             return null;
         }
         VehicleIllegalInfoResult vehicleIllegalInfoResult = JSON.toJavaObject(JSON.parseObject(result), VehicleIllegalInfoResult.class);
@@ -80,6 +90,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
                 || vehicleIllegalInfoResult.getResult().equals("2")) {
             // 查询错误,不计费
             CHARGE_LOGGER.info(JSON.toJSONString(new VehicleIllegalInfoChargeObject(vehicleIllegalInfoResult, false, requestParam.getTraceId())));
+            stringRedisTemplate.boundValueOps(CommonConstant.VEHICLE_ILLEGAL_INFO_QUERY_FAILED).increment();
         } else {
             // 查询成功,计费
             CHARGE_LOGGER.info(JSON.toJSONString(new VehicleIllegalInfoChargeObject(vehicleIllegalInfoResult, true, requestParam.getTraceId())));
@@ -114,6 +125,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
         log.info("调用上游接口-流水号:{}, 入参:{}, 返回:{}, 时延:{}", requestParams.getTraceId(), body, result, System.currentTimeMillis() - startTime);
         if (StringUtils.isBlank(result)) {
             log.info("调用上游接口-流水号:{}, 入参:{}, 请求上游失败无返回", requestParams.getTraceId(), body);
+            stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_TIME_OUT).increment();
             return null;
         }
         IllegalInfoResult illegalInfoResult = JSON.toJavaObject(JSON.parseObject(result), IllegalInfoResult.class);
@@ -124,6 +136,7 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
                 || illegalInfoResult.getIsPedigree().equals("2")) {
             // 查询错误,不计费
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, false, requestParams.getTraceId())));
+            stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_QUERY_FAILED).increment();
         } else {
             // 查询成功,计费
             CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, true, requestParams.getTraceId())));

+ 99 - 0
src/main/java/com/jkcredit/illegal/info/task/ExceptionListenerTask.java

@@ -0,0 +1,99 @@
+package com.jkcredit.illegal.info.task;
+
+import com.jkcredit.illegal.info.constant.CommonConstant;
+import com.jkcredit.illegal.info.model.SendDingMsgResponseObject;
+import com.jkcredit.illegal.info.util.DingRobotUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.util.Objects;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Component
+@Slf4j
+public class ExceptionListenerTask {
+    @Autowired
+    StringRedisTemplate stringRedisTemplate;
+
+    @XxlJob("personIllegalInfoTask")
+    public ReturnT<String> personIllegalInfoTask(String param) {
+        int timeOutCount = 0;
+        int queryFailedCount = 0;
+        String timeOut = stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_TIME_OUT).get();
+        String queryFailed = stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_QUERY_FAILED).get();
+        if (timeOut != null) {
+            timeOutCount = Integer.parseInt(timeOut);
+        }
+        if (queryFailed != null) {
+            queryFailedCount = Integer.parseInt(queryFailed);
+        }
+
+        String errorMessage = "社会风险预警-人员核验接口失败,失败原因:";
+        if (timeOutCount > 10) {
+            errorMessage += "数据源超时";
+            SendDingMsgResponseObject sendDingMsgResponseObject = DingRobotUtil.sendDingRobotMsg(errorMessage);
+            if (sendDingMsgResponseObject.getCode() != 1) {
+                log.info("personIllegalInfoTask, 发送钉钉异常:社会风险预警-人员核验接口失败-数据源超时");
+            }
+        }
+
+        if (queryFailedCount >10) {
+            errorMessage += "数据源返回结果异常";
+            SendDingMsgResponseObject sendDingMsgResponseObject = DingRobotUtil.sendDingRobotMsg(errorMessage);
+            if (sendDingMsgResponseObject.getCode() != 1) {
+                log.info("personIllegalInfoTask, 发送钉钉异常:社会风险预警-人员核验接口失败-数据源返回结果异常");
+            }
+        }
+        stringRedisTemplate.delete(CommonConstant.PERSON_ILLEGAL_INFO_TIME_OUT);
+        stringRedisTemplate.delete(CommonConstant.PERSON_ILLEGAL_INFO_QUERY_FAILED);
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("vehicleIllegalInfoTask")
+    public ReturnT<String> vehicleIllegalInfoTask(String param) {
+        int timeOutCount = 0;
+        int queryFailedCount = 0;
+        String timeOut = stringRedisTemplate.boundValueOps(CommonConstant.VEHICLE_ILLEGAL_INFO_TIME_OUT).get();
+        String queryFailed = stringRedisTemplate.boundValueOps(CommonConstant.VEHICLE_ILLEGAL_INFO_QUERY_FAILED).get();
+        if (timeOut != null) {
+            timeOutCount = Integer.parseInt(timeOut);
+        }
+        if (queryFailed != null) {
+            queryFailedCount = Integer.parseInt(queryFailed);
+        }
+
+        String errorMessage = "社会风险预警-车辆核验接口失败,失败原因:";
+        if (timeOutCount > 10) {
+            errorMessage += "数据源超时";
+            SendDingMsgResponseObject sendDingMsgResponseObject = DingRobotUtil.sendDingRobotMsg(errorMessage);
+            if (sendDingMsgResponseObject.getCode() != 1) {
+                log.info("vehicleIllegalInfoTask, 发送钉钉异常:社会风险预警-车辆核验接口失败-数据源超时");
+            }
+        }
+
+        if (queryFailedCount >10) {
+            errorMessage += "数据源返回结果异常";
+            SendDingMsgResponseObject sendDingMsgResponseObject = DingRobotUtil.sendDingRobotMsg(errorMessage);
+            if (sendDingMsgResponseObject.getCode() != 1) {
+                log.info("vehicleIllegalInfoTask, 发送钉钉异常:社会风险预警-车辆核验接口失败-数据源返回结果异常");
+            }
+        }
+        stringRedisTemplate.delete(CommonConstant.VEHICLE_ILLEGAL_INFO_TIME_OUT);
+        stringRedisTemplate.delete(CommonConstant.VEHICLE_ILLEGAL_INFO_QUERY_FAILED);
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("dingdingTestTask")
+    public ReturnT<String> dingdingTestTask(String param) {
+        String message = "社会风险预警-测试";
+        SendDingMsgResponseObject sendDingMsgResponseObject = DingRobotUtil.sendDingRobotMsg(message);
+        return ReturnT.SUCCESS;
+    }
+}

+ 59 - 0
src/main/java/com/jkcredit/illegal/info/util/DingRobotUtil.java

@@ -0,0 +1,59 @@
+package com.jkcredit.illegal.info.util;
+
+import com.alibaba.fastjson.JSON;
+import com.jkcredit.illegal.info.model.DingRobotResponseObject;
+import com.jkcredit.illegal.info.model.SendDingMsgResponseObject;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Component
+public class DingRobotUtil {
+
+    private static String dingRobotUrl;
+
+    @Value("${dingding.url}")
+    public void setDingRobotUrl(String dingRobotUrl) {
+        DingRobotUtil.dingRobotUrl = dingRobotUrl;
+    }
+
+//    public static String getDingRobotUrl() {
+//        return dingRobotUrl;
+//    }
+
+    public static SendDingMsgResponseObject sendDingRobotMsg(String msg) {
+        Map<String, String> contentMap = new HashMap<>();
+        contentMap.put("content", msg);
+
+        //通知人
+        Map<String, Object> atMap = new HashMap<>();
+        //1.是否通知所有人
+        atMap.put("isAtAll", true);
+
+        Map<String, Object> reqMap = new HashMap<>();
+        reqMap.put("msgtype", "text");
+        reqMap.put("text", contentMap);
+        reqMap.put("at", atMap);
+
+        String responseString = OkHttpUtil.doHttpPost(dingRobotUrl, JSON.toJSONString(reqMap));
+        if (StringUtils.isNotBlank(responseString)) {
+            DingRobotResponseObject DingRobotResponseObject = JSON.toJavaObject(JSON.parseObject(responseString),
+                    DingRobotResponseObject.class);
+            if (DingRobotResponseObject.getErrorCode() == 0) {
+                return SendDingMsgResponseObject.success(DingRobotResponseObject.getErrorMsg());
+            } else {
+                return SendDingMsgResponseObject.failure(DingRobotResponseObject.getErrorMsg());
+            }
+
+        } else {
+            return SendDingMsgResponseObject.failure("发送消息失败");
+        }
+    }
+}

+ 24 - 0
src/main/java/com/jkcredit/illegal/info/util/OkHttpUtil.java

@@ -54,4 +54,28 @@ public class OkHttpUtil {
         }
         return responseContext;
     }
+
+    public static String doHttpPost(String url, String jsonString) {
+        MediaType mediaType = MediaType.parse(CommonConstant.APPLICATION_JSON_UTF8_VALUE);
+        RequestBody requestBody = RequestBody.create(mediaType, jsonString);
+        Request okRequest = new Request.Builder().post(requestBody).url(url).build();
+        OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
+        OkHttpClient client = okHttpClient.newBuilder()
+                .connectTimeout(CommonConstant.TIME_OUT, TimeUnit.MILLISECONDS)
+                .readTimeout(CommonConstant.TIME_OUT, TimeUnit.MILLISECONDS)
+                .writeTimeout(CommonConstant.TIME_OUT, TimeUnit.MILLISECONDS)
+                .build();
+
+        try {
+            Response response = client.newCall(okRequest).execute();
+            String responseContext = "";
+            if (response.body() != null) {
+                responseContext = response.body().string();
+            }
+            return responseContext;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
 }

+ 17 - 0
src/main/resources/application.yml

@@ -10,3 +10,20 @@ illegalInfo:
 #  certificateUrl: /Users/jkxy/Desktop/client.pfx
   certificatePassword: client
   decodeKey: 374c72b109292ad4
+dingding:
+  url: https://oapi.dingtalk.com/robot/send?access_token=64e1e991ba9d148cd837c9d49f9ce82bfcfb7f8ad371c08ec392c0fca5806738
+redis:
+  host: 127.0.0.1
+  port: 6379
+  password: jiaokedata
+xxl:
+  job:
+    admin:
+      addresses: http://192.168.1.184:18083/xxl-job-admin
+    executor:
+      appname: illegal-info-executor
+      ip:
+      port: -1
+      logpath: /home/tpuser/apps/illegal-info-v2/logs/xxljob
+      logretentiondays: 30
+    accessToken:

+ 3 - 7
src/main/resources/logback-spring.xml

@@ -22,9 +22,8 @@
     <appender name="errorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
         <file>${log.path}/error/error.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/error/%d{yyyy-MM}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <fileNamePattern>${log.path}/error/%d{yyyy-MM,aux}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
             <maxFileSize>50MB</maxFileSize>
-            <maxHistory>30</maxHistory>
         </rollingPolicy>
         <encoder>
             <pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
@@ -45,9 +44,8 @@
         </filter>
         <file>${log.path}/source/source.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/source/%d{yyyy-MM}/source-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <fileNamePattern>${log.path}/source/%d{yyyy-MM,aux}/source-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
             <maxFileSize>50MB</maxFileSize>
-            <maxHistory>30</maxHistory>
         </rollingPolicy>
         <encoder>
             <pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
@@ -64,9 +62,8 @@
         </filter>
         <file>${log.path}/charge/charge.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}/charge/%d{yyyy-MM}/charge-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <fileNamePattern>${log.path}/charge/%d{yyyy-MM,aux}/charge-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
             <maxFileSize>50MB</maxFileSize>
-            <maxHistory>30</maxHistory>
         </rollingPolicy>
         <encoder>
             <pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
@@ -82,7 +79,6 @@
         <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
             <fileNamePattern>${log.path}/test/test-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
             <maxFileSize>50MB</maxFileSize>
-            <maxHistory>30</maxHistory>
         </rollingPolicy>
         <encoder>
             <pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>