Commit a569dedcec825e69a970ac2dbc7410262dd7365e
1 parent
635f7401
Exists in
master
博冠人脸 日志 优化
Showing
8 changed files
with
165 additions
and
90 deletions
Show diff stats
cloud/lapi/src/main/java/com/sincere/lapi/controller/LapiController.java
| @@ -5,10 +5,13 @@ import com.sincere.common.dto.smartCampus.SzVSchoolTeacher; | @@ -5,10 +5,13 @@ import com.sincere.common.dto.smartCampus.SzVSchoolTeacher; | ||
| 5 | import com.sincere.lapi.Utils.FileUtils; | 5 | import com.sincere.lapi.Utils.FileUtils; |
| 6 | import com.sincere.lapi.feign.ScFeign; | 6 | import com.sincere.lapi.feign.ScFeign; |
| 7 | import com.sincere.lapi.feign.XaFeign; | 7 | import com.sincere.lapi.feign.XaFeign; |
| 8 | +import com.sincere.lapi.logs.LogName; | ||
| 9 | +import com.sincere.lapi.logs.LoggerUtils; | ||
| 8 | import com.sincere.lapi.pojo.*; | 10 | import com.sincere.lapi.pojo.*; |
| 9 | import com.sincere.lapi.service.request.TerminalHttpCall; | 11 | import com.sincere.lapi.service.request.TerminalHttpCall; |
| 10 | import io.swagger.annotations.ApiOperation; | 12 | import io.swagger.annotations.ApiOperation; |
| 11 | import org.apache.commons.lang3.StringUtils; | 13 | import org.apache.commons.lang3.StringUtils; |
| 14 | +import org.slf4j.Logger; | ||
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.web.bind.annotation.RequestMapping; | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| 14 | import org.springframework.web.bind.annotation.RequestMethod; | 17 | import org.springframework.web.bind.annotation.RequestMethod; |
| @@ -35,6 +38,7 @@ public class LapiController { | @@ -35,6 +38,7 @@ public class LapiController { | ||
| 35 | @Autowired | 38 | @Autowired |
| 36 | TerminalHttpCall terminalHttpCall = new TerminalHttpCall(); | 39 | TerminalHttpCall terminalHttpCall = new TerminalHttpCall(); |
| 37 | 40 | ||
| 41 | + private static final Logger Log_operate = LoggerUtils.Logger(LogName.operate); | ||
| 38 | /** | 42 | /** |
| 39 | * 下发整个学校 | 43 | * 下发整个学校 |
| 40 | * @param deviceIds 多个设备用,隔开 | 44 | * @param deviceIds 多个设备用,隔开 |
| @@ -43,7 +47,7 @@ public class LapiController { | @@ -43,7 +47,7 @@ public class LapiController { | ||
| 43 | */ | 47 | */ |
| 44 | @RequestMapping(value = "sendFaces", method = RequestMethod.GET) | 48 | @RequestMapping(value = "sendFaces", method = RequestMethod.GET) |
| 45 | @ApiOperation(value = "下发学校下所有人脸给指定设备", notes = "下发所有人脸给指定设备") | 49 | @ApiOperation(value = "下发学校下所有人脸给指定设备", notes = "下发所有人脸给指定设备") |
| 46 | - public void sendFaces(@RequestParam("deviceIds") String deviceIds, @RequestParam("schoolId") String schoolId, @RequestParam("userType") String userType) { | 50 | + public boolean sendFaces(@RequestParam("deviceIds") String deviceIds, @RequestParam("schoolId") String schoolId, @RequestParam("userType") String userType) { |
| 47 | String[] deviceList = deviceIds.split(","); | 51 | String[] deviceList = deviceIds.split(","); |
| 48 | if(userType.equals("1")){ | 52 | if(userType.equals("1")){ |
| 49 | List<SzVSchoolTeacher> list = scFeign.selectTeacherBySchoolId(schoolId) ; | 53 | List<SzVSchoolTeacher> list = scFeign.selectTeacherBySchoolId(schoolId) ; |
| @@ -57,6 +61,7 @@ public class LapiController { | @@ -57,6 +61,7 @@ public class LapiController { | ||
| 57 | sendStudentBatch(list,deviceId); | 61 | sendStudentBatch(list,deviceId); |
| 58 | } | 62 | } |
| 59 | } | 63 | } |
| 64 | + return false ; | ||
| 60 | } | 65 | } |
| 61 | 66 | ||
| 62 | private List<SzVSchoolTeacher> removeDuplicateCase(List<SzVSchoolTeacher> cases) { | 67 | private List<SzVSchoolTeacher> removeDuplicateCase(List<SzVSchoolTeacher> cases) { |
| @@ -112,6 +117,7 @@ public class LapiController { | @@ -112,6 +117,7 @@ public class LapiController { | ||
| 112 | } | 117 | } |
| 113 | 118 | ||
| 114 | private void sendImg(long personId , String name , String code , String fileUrl , String deviceId , int userType){ | 119 | private void sendImg(long personId , String name , String code , String fileUrl , String deviceId , int userType){ |
| 120 | + Log_operate.info("开始下发人脸----设备号:"+deviceId+"---姓名:"+name+"--fileUrl:"+fileUrl); | ||
| 115 | PersonInfoList personInfoList = new PersonInfoList(); | 121 | PersonInfoList personInfoList = new PersonInfoList(); |
| 116 | List<PersonInfo> list1 = new ArrayList<PersonInfo>(); | 122 | List<PersonInfo> list1 = new ArrayList<PersonInfo>(); |
| 117 | personInfoList.setPersonInfoList(list1); | 123 | personInfoList.setPersonInfoList(list1); |
cloud/lapi/src/main/java/com/sincere/lapi/logs/LogName.java
0 → 100644
| @@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
| 1 | +package com.sincere.lapi.logs; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * @author chen | ||
| 5 | + * @version 1.0 | ||
| 6 | + * @date 2019/10/12 0012 16:18 | ||
| 7 | + */ | ||
| 8 | +public enum LogName { | ||
| 9 | + operate("operate"), | ||
| 10 | + report("report"); | ||
| 11 | + | ||
| 12 | + private String logFileName; | ||
| 13 | + | ||
| 14 | + LogName(String fileName) { | ||
| 15 | + this.logFileName = fileName; | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + public String getLogFileName() { | ||
| 19 | + return logFileName; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + public void setLogFileName(String logFileName) { | ||
| 23 | + this.logFileName = logFileName; | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + public static LogName getAwardTypeEnum(String value) { | ||
| 27 | + LogName[] arr = values(); | ||
| 28 | + for (LogName item : arr) { | ||
| 29 | + if (null != item && !item.logFileName.equals("")) { | ||
| 30 | + return item; | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + return null; | ||
| 34 | + } | ||
| 35 | +} | ||
| 36 | + |
cloud/lapi/src/main/java/com/sincere/lapi/logs/LoggerUtils.java
0 → 100644
| @@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
| 1 | +package com.sincere.lapi.logs; | ||
| 2 | + | ||
| 3 | +import org.slf4j.Logger; | ||
| 4 | +import org.slf4j.LoggerFactory; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @author chen | ||
| 8 | + * @version 1.0 | ||
| 9 | + * @date 2019/10/12 0012 16:19 | ||
| 10 | + */ | ||
| 11 | +public class LoggerUtils { | ||
| 12 | + | ||
| 13 | + public static <T> Logger Logger(Class<T> clazz) { | ||
| 14 | + return LoggerFactory.getLogger(clazz); | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 打印到指定的文件下 | ||
| 19 | + * | ||
| 20 | + * @param desc 日志文件名称 | ||
| 21 | + * @return | ||
| 22 | + */ | ||
| 23 | + public static Logger Logger(LogName desc) { | ||
| 24 | + return LoggerFactory.getLogger(desc.getLogFileName()); | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | +} |
cloud/lapi/src/main/java/com/sincere/lapi/logs/MyTimeBasedFileNamingAndTriggeringPolicy.java
0 → 100644
| @@ -0,0 +1,32 @@ | @@ -0,0 +1,32 @@ | ||
| 1 | +package com.sincere.lapi.logs; | ||
| 2 | + | ||
| 3 | +import ch.qos.logback.core.joran.spi.NoAutoStart; | ||
| 4 | +import ch.qos.logback.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @author chen | ||
| 8 | + * @version 1.0 | ||
| 9 | + * @date 2019/10/31 0031 13:42 | ||
| 10 | + */ | ||
| 11 | +@NoAutoStart | ||
| 12 | +public class MyTimeBasedFileNamingAndTriggeringPolicy<E> extends DefaultTimeBasedFileNamingAndTriggeringPolicy<E> { | ||
| 13 | + | ||
| 14 | + //这个用来指定时间间隔 | ||
| 15 | + private Integer multiple = 1; | ||
| 16 | + | ||
| 17 | + @Override | ||
| 18 | + protected void computeNextCheck() { | ||
| 19 | + nextCheck = rc.getEndOfNextNthPeriod(dateInCurrentPeriod, multiple).getTime(); | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + public Integer getMultiple() { | ||
| 23 | + return multiple; | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + public void setMultiple(Integer multiple) { | ||
| 27 | + if (multiple > 1) { | ||
| 28 | + this.multiple = multiple; | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | +} |
cloud/lapi/src/main/java/com/sincere/lapi/server/handler/HttpClientHandler.java
| @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray; | @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray; | ||
| 4 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.sincere.common.util.DateUtils; | 5 | import com.sincere.common.util.DateUtils; |
| 6 | import com.sincere.lapi.Utils.SpringContextHolder; | 6 | import com.sincere.lapi.Utils.SpringContextHolder; |
| 7 | +import com.sincere.lapi.logs.LogName; | ||
| 8 | +import com.sincere.lapi.logs.LoggerUtils; | ||
| 7 | import com.sincere.lapi.pojo.HeartInfo; | 9 | import com.sincere.lapi.pojo.HeartInfo; |
| 8 | import com.sincere.lapi.pojo.LAPI; | 10 | import com.sincere.lapi.pojo.LAPI; |
| 9 | import com.sincere.lapi.pojo.LAPIResponse; | 11 | import com.sincere.lapi.pojo.LAPIResponse; |
| @@ -29,7 +31,7 @@ import static io.netty.buffer.Unpooled.copiedBuffer; | @@ -29,7 +31,7 @@ import static io.netty.buffer.Unpooled.copiedBuffer; | ||
| 29 | 31 | ||
| 30 | public class HttpClientHandler extends ChannelInboundHandlerAdapter { | 32 | public class HttpClientHandler extends ChannelInboundHandlerAdapter { |
| 31 | 33 | ||
| 32 | - Logger logger = LoggerFactory.getLogger(HttpClientHandler.class); | 34 | + private static final Logger Log_report = LoggerUtils.Logger(LogName.report); |
| 33 | 35 | ||
| 34 | @Override | 36 | @Override |
| 35 | public void channelRead(ChannelHandlerContext ctx, Object msg) | 37 | public void channelRead(ChannelHandlerContext ctx, Object msg) |
| @@ -37,7 +39,7 @@ public class HttpClientHandler extends ChannelInboundHandlerAdapter { | @@ -37,7 +39,7 @@ public class HttpClientHandler extends ChannelInboundHandlerAdapter { | ||
| 37 | TerminalHttpCall call = SpringContextHolder.getTerminalHttpCall(); | 39 | TerminalHttpCall call = SpringContextHolder.getTerminalHttpCall(); |
| 38 | AttendanceService attendanceService = SpringContextHolder.getAttendanceService(); | 40 | AttendanceService attendanceService = SpringContextHolder.getAttendanceService(); |
| 39 | String content = (String) msg; | 41 | String content = (String) msg; |
| 40 | - logger.info(content); | 42 | + Log_report.info(content); |
| 41 | //心跳 更新设备 | 43 | //心跳 更新设备 |
| 42 | if (content.contains("/LAPI/V1.0/PACS/Controller/HeartReportInfo")) { | 44 | if (content.contains("/LAPI/V1.0/PACS/Controller/HeartReportInfo")) { |
| 43 | HeartInfo heartInfo = JSONObject.parseObject(getJson(content),HeartInfo.class); | 45 | HeartInfo heartInfo = JSONObject.parseObject(getJson(content),HeartInfo.class); |
cloud/lapi/src/main/java/com/sincere/lapi/service/request/AttendanceService.java
| @@ -12,7 +12,10 @@ import com.sincere.common.dto.xiaoan.FaceSendsuccess; | @@ -12,7 +12,10 @@ import com.sincere.common.dto.xiaoan.FaceSendsuccess; | ||
| 12 | import com.sincere.common.util.DateUtils; | 12 | import com.sincere.common.util.DateUtils; |
| 13 | import com.sincere.lapi.feign.ScFeign; | 13 | import com.sincere.lapi.feign.ScFeign; |
| 14 | import com.sincere.lapi.feign.XaFeign; | 14 | import com.sincere.lapi.feign.XaFeign; |
| 15 | +import com.sincere.lapi.logs.LogName; | ||
| 16 | +import com.sincere.lapi.logs.LoggerUtils; | ||
| 15 | import com.sincere.lapi.pojo.LAPIResponse; | 17 | import com.sincere.lapi.pojo.LAPIResponse; |
| 18 | +import org.slf4j.Logger; | ||
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
| 18 | 21 | ||
| @@ -23,6 +26,9 @@ import java.util.Map; | @@ -23,6 +26,9 @@ import java.util.Map; | ||
| 23 | @Service("attendanceService") | 26 | @Service("attendanceService") |
| 24 | public class AttendanceService { | 27 | public class AttendanceService { |
| 25 | 28 | ||
| 29 | + | ||
| 30 | + private static final Logger Log_operate = LoggerUtils.Logger(LogName.operate); | ||
| 31 | + | ||
| 26 | @Autowired | 32 | @Autowired |
| 27 | ScFeign scFeign ; | 33 | ScFeign scFeign ; |
| 28 | 34 | ||
| @@ -80,6 +86,7 @@ public class AttendanceService { | @@ -80,6 +86,7 @@ public class AttendanceService { | ||
| 80 | record.setSchoolid(student.getSchoolId()); | 86 | record.setSchoolid(student.getSchoolId()); |
| 81 | scFeign.insertTemperature(record); | 87 | scFeign.insertTemperature(record); |
| 82 | } | 88 | } |
| 89 | + Log_operate.info("刷脸成功-----设备号:"+deviceCode+"---------"+"name:"+faceRecoder.getName()); | ||
| 83 | xaFeign.insertRecode(faceRecoder); | 90 | xaFeign.insertRecode(faceRecoder); |
| 84 | } | 91 | } |
| 85 | 92 | ||
| @@ -111,8 +118,10 @@ public class AttendanceService { | @@ -111,8 +118,10 @@ public class AttendanceService { | ||
| 111 | schoolId = student.getSchoolId(); | 118 | schoolId = student.getSchoolId(); |
| 112 | } | 119 | } |
| 113 | if(code == 0){ | 120 | if(code == 0){ |
| 121 | + Log_operate.info("下发成功-----设备号:"+deviceCode+"---------"+"name:"+name); | ||
| 114 | insertSuccess(deviceCode,personId,num,name,photo,schoolId,userType); | 122 | insertSuccess(deviceCode,personId,num,name,photo,schoolId,userType); |
| 115 | }else { | 123 | }else { |
| 124 | + Log_operate.info("下发失败-----设备号:"+deviceCode+"---------"+"name:"+name); | ||
| 116 | insertFail(deviceCode,personId,num,name,photo,schoolId,userType,code,resultCodeMap.get(code)); | 125 | insertFail(deviceCode,personId,num,name,photo,schoolId,userType,code,resultCodeMap.get(code)); |
| 117 | } | 126 | } |
| 118 | }else { | 127 | }else { |
cloud/lapi/src/main/resources/application.yml
| @@ -9,7 +9,7 @@ ribbon: | @@ -9,7 +9,7 @@ ribbon: | ||
| 9 | eureka: | 9 | eureka: |
| 10 | client: | 10 | client: |
| 11 | serviceUrl: | 11 | serviceUrl: |
| 12 | - defaultZone: http://127.0.0.1:8761/eureka/,http://127.0.0.1:8762/eureka/ | 12 | + defaultZone: http://121.40.109.21:8761/eureka/,http://121.40.109.21:8762/eureka/ |
| 13 | registry-fetch-interval-seconds: 5 | 13 | registry-fetch-interval-seconds: 5 |
| 14 | instance-info-replication-interval-seconds: 10 | 14 | instance-info-replication-interval-seconds: 10 |
| 15 | instance: | 15 | instance: |
cloud/lapi/src/main/resources/logback.xml
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<configuration debug="true"> | ||
| 3 | - <!-- 项目名称 --> | ||
| 4 | - | ||
| 5 | - <property name="PROJECT_NAME" value="bo_guan"/> | ||
| 6 | - | ||
| 7 | - <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> | ||
| 8 | - <property name="LOG_HOME" value="C://log"/> | ||
| 9 | - | ||
| 10 | - <!-- 控制台输出 --> | ||
| 11 | - | ||
| 12 | - <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
| 13 | - <!--<withJansi>true</withJansi>--> | ||
| 14 | - | ||
| 15 | - <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
| 16 | - <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> | ||
| 17 | - | ||
| 18 | - <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %highlight([%-5level] %logger{50} - %msg%n)</pattern> | ||
| 19 | - | ||
| 20 | - <charset>UTF-8</charset> | ||
| 21 | - | ||
| 22 | - </encoder> | ||
| 23 | - | 1 | +<?xml version="1.0" encoding="utf-8" ?> |
| 2 | +<configuration scan="true" scanPeriod="60 seconds" debug="false"> | ||
| 3 | + <!-- 定义日志文件 输入位置 --> | ||
| 4 | + <property name="logPath" value="c:/bg_log" /> | ||
| 5 | + <!-- 日志最大的历史 30天 --> | ||
| 6 | + <property name="maxHistory" value="600"/> | ||
| 7 | + | ||
| 8 | + <!-- 配置项, 通过此节点配置日志输出位置(控制台、文件、数据库)、输出格式等--> | ||
| 9 | + <!-- ConsoleAppender代表输出到控制台 --> | ||
| 10 | + <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender"> | ||
| 11 | + <!-- layout代表输出格式 --> | ||
| 12 | + <layout class="ch.qos.logback.classic.PatternLayout"> | ||
| 13 | + <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger -%msg%n</pattern> | ||
| 14 | + </layout> | ||
| 24 | </appender> | 15 | </appender> |
| 25 | - | ||
| 26 | - <!-- 按照每天生成日志文件 --> | ||
| 27 | - | ||
| 28 | - <appender name="SYSTEM_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 29 | - <!-- 过滤器,只打印ERROR级别的日志 --> | ||
| 30 | - | ||
| 31 | - <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | ||
| 32 | - <!--日志文件输出的文件名--> | ||
| 33 | - | ||
| 34 | - <FileNamePattern>${LOG_HOME}/${PROJECT_NAME}/%d{yyyy-MM-dd}.%i.log</FileNamePattern> | ||
| 35 | - <!--日志文件保留天数--> | ||
| 36 | - | ||
| 37 | - <MaxHistory>30</MaxHistory> | ||
| 38 | - <!--日志文件最大的大小--> | ||
| 39 | - | ||
| 40 | - <MaxFileSize>100MB</MaxFileSize> | ||
| 41 | - | 16 | + <!-- 日志输出文件 --> |
| 17 | + <appender name="operateLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 18 | + <encoder> | ||
| 19 | + <pattern>%d{yyyy-MM-dd HH:mm:ss} -%msg%n</pattern> | ||
| 20 | + </encoder> | ||
| 21 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
| 22 | + <timeBasedFileNamingAndTriggeringPolicy class="com.sincere.lapi.logs.MyTimeBasedFileNamingAndTriggeringPolicy"> | ||
| 23 | + <multiple>1</multiple> | ||
| 24 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
| 25 | + <!-- 输出路径 --> | ||
| 26 | + <fileNamePattern>${logPath}/info/operate/%d{yyyy-MM-dd HH}.log</fileNamePattern> | ||
| 27 | + <maxHistory>${maxHistory}</maxHistory> | ||
| 42 | </rollingPolicy> | 28 | </rollingPolicy> |
| 43 | - | ||
| 44 | - | ||
| 45 | - <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
| 46 | - <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> | ||
| 47 | - | ||
| 48 | - <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] [%-5level] %logger{50} - %msg%n</pattern> | ||
| 49 | - | ||
| 50 | - <charset>UTF-8</charset> | ||
| 51 | - | 29 | + </appender> |
| 30 | + <appender name="reportLog" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
| 31 | + <encoder> | ||
| 32 | + <pattern>%d{yyyy-MM-dd HH:mm:ss} -%msg%n</pattern> | ||
| 52 | </encoder> | 33 | </encoder> |
| 53 | - | 34 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 35 | + <timeBasedFileNamingAndTriggeringPolicy class="com.sincere.lapi.logs.MyTimeBasedFileNamingAndTriggeringPolicy"> | ||
| 36 | + <multiple>1</multiple> | ||
| 37 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
| 38 | + <!-- 输出路径 --> | ||
| 39 | + <fileNamePattern>${logPath}/info/report/%d{yyyy-MM-dd HH}.log</fileNamePattern> | ||
| 40 | + <maxHistory>${maxHistory}</maxHistory> | ||
| 41 | + </rollingPolicy> | ||
| 54 | </appender> | 42 | </appender> |
| 55 | - | ||
| 56 | - <logger name="system_error" additivity="true"> | ||
| 57 | - | ||
| 58 | - <appender-ref ref="SYSTEM_FILE"/> | ||
| 59 | - | ||
| 60 | - </logger> | ||
| 61 | 43 | ||
| 62 | - <!-- 设置Spring&Hibernate日志输出级别 --> | ||
| 63 | - | ||
| 64 | - <logger name="org.springframework" level="WARN"/> | ||
| 65 | - | ||
| 66 | - <logger name="org.mybatis" level="WARN"/> | ||
| 67 | - | ||
| 68 | - <logger name="com.ibatis" level="DEBUG"/> | ||
| 69 | - | ||
| 70 | - <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG"/> | ||
| 71 | - | ||
| 72 | - <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG"/> | ||
| 73 | - | ||
| 74 | - <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG"/> | ||
| 75 | 44 | ||
| 45 | + <!-- 不同的业务逻辑日志打印到指定文件夹--> | ||
| 46 | + <logger name="operate" additivity="false" level="INFO"> | ||
| 47 | + <appender-ref ref="operateLog"/> | ||
| 48 | + </logger> | ||
| 49 | + <logger name="report" additivity="false" level="INFO"> | ||
| 50 | + <appender-ref ref="reportLog"/> | ||
| 51 | + </logger> | ||
| 76 | 52 | ||
| 77 | - | ||
| 78 | - <logger name="java.sql.Connection" level="DEBUG"/> | ||
| 79 | - | ||
| 80 | - <logger name="java.sql.Statement" level="DEBUG"/> | ||
| 81 | - | ||
| 82 | - <logger name="java.sql.PreparedStatement" level="DEBUG"/> | ||
| 83 | - | ||
| 84 | - <logger name="com.sincere.smartSearch.mapper" level="DEBUG"/> | ||
| 85 | - <!-- 开发环境下的日志配置 --> | ||
| 86 | - | ||
| 87 | - <root level="INFO"> | ||
| 88 | - | ||
| 89 | - <appender-ref ref="CONSOLE"/> | ||
| 90 | - | ||
| 91 | - <appender-ref ref="SYSTEM_FILE"/> | ||
| 92 | - | 53 | + <root level="info"> |
| 54 | + <appender-ref ref="operateLog" /> | ||
| 55 | + <appender-ref ref="reportLog" /> | ||
| 93 | </root> | 56 | </root> |
| 94 | 57 | ||
| 95 | -</configuration> | 58 | -</configuration> |
| 59 | +</configuration> | ||
| 96 | \ No newline at end of file | 60 | \ No newline at end of file |