Commit 936eec0bf8c1036982e634e813cb4661f77101ea

Authored by yiming
1 parent 0d0e1c7e

去除myBatis日志 加上kafka发送成功的日志

src/main/java/com/example/demo/service/Contrast.java
... ... @@ -16,8 +16,6 @@ import org.springframework.kafka.support.SendResult;
16 16 import org.springframework.stereotype.Service;
17 17 import org.springframework.util.concurrent.ListenableFuture;
18 18 import org.springframework.util.concurrent.ListenableFutureCallback;
19   -
20   -import javax.annotation.Resource;
21 19 import java.text.ParseException;
22 20 import java.text.SimpleDateFormat;
23 21 import java.time.*;
... ... @@ -319,6 +317,7 @@ public class Contrast {
319 317 future.addCallback(new ListenableFutureCallback<SendResult<String, String>>() {
320 318 @Override
321 319 public void onSuccess(SendResult<String, String> result) {
  320 + logger.info("kafka发送票务数据成功条数:"+data.size());
322 321 }
323 322 @Override
324 323 public void onFailure(Throwable ex) {
... ...
src/main/resources/application.properties
... ... @@ -17,7 +17,7 @@ spring.datasource.db2.druid.test-while-idle=true
17 17  
18 18 mybatis.mapperLocations=classpath:mapping/**/*.xml
19 19 mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
20   -logging.level.com.example.demo.mapper=debug
  20 +logging.level.com.example.demo.mapper=info
21 21 #logging.level.org.mybatis = debug
22 22  
23 23  
... ...
src/main/resources/logback.xml
... ... @@ -11,9 +11,7 @@
11 11 <!--获取比info级别高(包括info级别)但除error级别的日志-->
12 12 <appender name="INFO-LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
13 13 <filter class="ch.qos.logback.classic.filter.LevelFilter">
14   - <level>ERROR</level>
15   - <onMatch>DENY</onMatch>
16   - <onMismatch>ACCEPT</onMismatch>
  14 + <level>INFO</level>
17 15 </filter>
18 16 <encoder>
19 17 <pattern>[%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%L] [%-5p] %m%n</pattern>
... ...