Forráskód Böngészése

业务日志单独的打印级别

zouxuan 1 éve
szülő
commit
9dddffea16

+ 9 - 0
mec-application/src/main/java/com/ym/mec/AppServerApplication.java

@@ -5,6 +5,8 @@ import com.ym.mec.config.AppBeanNameGenerator;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.logging.LogLevel;
+import org.springframework.boot.logging.LoggingSystem;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.ComponentScan;
@@ -22,5 +24,12 @@ public class AppServerApplication {
         new SpringApplicationBuilder(AppServerApplication.class)
                 .beanNameGenerator(new AppBeanNameGenerator())
                 .run(args);
+        configureGlobalLogger();
+    }
+
+    private static void configureGlobalLogger() {
+        LoggingSystem loggingSystem = LoggingSystem.get(ClassLoader.getSystemClassLoader());
+        // 设置业务日志记录器的日志级别为INFO
+        loggingSystem.setLogLevel("businessLogger", LogLevel.INFO);
     }
 }

+ 9 - 0
mec-im/src/main/java/com/ym/SealClassApplication.java

@@ -4,6 +4,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.logging.LogLevel;
+import org.springframework.boot.logging.LoggingSystem;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
 import org.springframework.cloud.openfeign.EnableFeignClients;
@@ -29,9 +31,16 @@ public class SealClassApplication {
 
 	public static void main(String[] args) {
 		SpringApplication.run(SealClassApplication.class, args);
+		configureGlobalLogger();
 		log.info("SealClassApplication started");
 	}
 
+	private static void configureGlobalLogger() {
+		LoggingSystem loggingSystem = LoggingSystem.get(ClassLoader.getSystemClassLoader());
+		// 设置业务日志记录器的日志级别为INFO
+		loggingSystem.setLogLevel("businessLogger", LogLevel.INFO);
+	}
+
 	@Bean
 	@LoadBalanced
 	public RestTemplate restTemplate(){

+ 15 - 13
mec-im/src/main/java/com/ym/controller/RoomController.java

@@ -10,8 +10,9 @@ import com.ym.service.RoomService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
 import org.joda.time.DateTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -20,13 +21,14 @@ import java.util.Objects;
 
 @RestController
 @RequestMapping("/room")
-@Slf4j
 public class RoomController{
     @Autowired
     RoomService roomService;
     @Autowired
     MessageService messageService;
 
+    private final static Logger businessLogger = LoggerFactory.getLogger(RoomController.class);
+
     @RequestMapping(value = "/join", method = RequestMethod.POST)
     public BaseResponse joinRoom(@RequestBody ReqUserData data) throws Exception {
         return roomService.joinRoom(data.getRoomId(), true);
@@ -70,7 +72,7 @@ public class RoomController{
 
     @RequestMapping(value = "/sendImPlayMidiMessage", method = RequestMethod.POST)
     public Object sendImPlayMidiMessage(@RequestBody PlayMidiMessageData playMidiMessageData) throws Exception {
-        log.info("sendImPlayMidiMessage: {}",JSONObject.toJSON(playMidiMessageData));
+        businessLogger.info("sendImPlayMidiMessage: {}",JSONObject.toJSON(playMidiMessageData));
         roomService.sendImPlayMidiMessage(playMidiMessageData);
         return new BaseResponse<>();
     }
@@ -90,7 +92,7 @@ public class RoomController{
 
     @RequestMapping(value = "joinRoomStatusNotify", method = RequestMethod.POST)
     public Object joinRoomStatusNotify(@RequestBody RoomStatusNotify roomStatusNotify) throws Exception {
-        log.info("joinRoomStatusNotify: {}",JSONObject.toJSON(roomStatusNotify));
+        businessLogger.info("joinRoomStatusNotify: {}",JSONObject.toJSON(roomStatusNotify));
         String roomId = roomStatusNotify.getRoomId();
         String userId = roomStatusNotify.getUserId();
         String deviceNum = roomStatusNotify.getDeviceNum();
@@ -106,7 +108,7 @@ public class RoomController{
     public void statusSync(@RequestBody String body) throws Exception {
         try {
             ChannelStateNotify notify = JSONObject.parseObject(body, ChannelStateNotify.class);
-            log.info("statusSyncParam: {}",JSONObject.toJSON(notify));
+            businessLogger.info("statusSyncParam: {}",JSONObject.toJSON(notify));
             String roomId = notify.getChannelId();
             String userId = notify.getUserId();
             switch (notify.getEvent()){
@@ -120,7 +122,7 @@ public class RoomController{
                     break;
             }
         }catch (Exception e){
-            log.error(e.getLocalizedMessage());
+            businessLogger.error(e.getLocalizedMessage());
         }
     }
 
@@ -129,10 +131,10 @@ public class RoomController{
     public void statusSyncTencent(@RequestBody TencentData.TRTCEventInfo eventInfo) {
         try {
             if (Objects.isNull(eventInfo.getEventInfo())) {
-                log.warn("statusSyncTencent eventInfo is null, time={}", DateTime.now().toString("yyy-MM-dd HH:mm:ss"));
+                businessLogger.warn("statusSyncTencent eventInfo is null, time={}", DateTime.now().toString("yyy-MM-dd HH:mm:ss"));
                 return;
             }
-            log.info("statusSyncTencent: {}", eventInfo.jsonString());
+            businessLogger.info("statusSyncTencent: {}", eventInfo.jsonString());
             String roomId = eventInfo.getEventInfo().getRoomId();
 
             // 网络教室回调整消息
@@ -189,7 +191,7 @@ public class RoomController{
             }
 
         }catch (Exception e){
-            log.error("statusSyncTencent event={}", eventInfo.jsonString(), e);
+            businessLogger.error("statusSyncTencent event={}", eventInfo.jsonString(), e);
         }
     }
 
@@ -258,14 +260,14 @@ public class RoomController{
     @RequestMapping(value = "/device/control", method = RequestMethod.POST)
     public Object controlDevice(@RequestBody ReqDeviceControlData data)
             throws Exception {
-        log.info("device_control: {}",JSONObject.toJSON(data));
+        businessLogger.info("device_control: {}",JSONObject.toJSON(data));
         return new BaseResponse<>(roomService.controlDevice(data));
     }
 
     @ApiOperation(value = "学员伴奏下载状态回调")
     @RequestMapping(value = "adjustExamSong", method = RequestMethod.POST)
     public Object adjustExamSong(@RequestBody ExamSongData examSongData) throws Exception {
-        log.info("adjustExamSong: {}",JSONObject.toJSON(examSongData));
+        businessLogger.info("adjustExamSong: {}",JSONObject.toJSON(examSongData));
         roomService.adjustExamSong(examSongData.getRoomId(),examSongData.getStatus(),examSongData.getExamSongId());
         return new BaseResponse<>();
     }
@@ -280,14 +282,14 @@ public class RoomController{
     @ApiOperation(value = "学员麦克风、摄像头等开关批量控制")
     @RequestMapping(value = "/device/batchControl", method = RequestMethod.POST)
     public Object batchControlDevice(@RequestBody ReqDeviceControlData data)throws Exception {
-        log.info("batchControl: {}",JSONObject.toJSON(data));
+        businessLogger.info("batchControl: {}",JSONObject.toJSON(data));
         return new BaseResponse<>(roomService.batchControlDevice(data));
     }
 
     @RequestMapping(value = "/device/sync", method = RequestMethod.POST)
     public Object syncDeviceState(@RequestBody ReqDeviceControlData data)
             throws Exception {
-        log.info("syncDeviceState: {}",JSONObject.toJSON(data));
+        businessLogger.info("syncDeviceState: {}",JSONObject.toJSON(data));
         return new BaseResponse<>(roomService.syncDeviceState(data));
     }
 

+ 78 - 78
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -45,18 +45,18 @@ import com.ym.mec.im.message.*;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.pojo.*;
-import com.ym.service.RoomMemberService;
 import com.ym.service.RoomService;
 import com.ym.utils.CheckUtils;
 import com.ym.utils.CodeUtil;
 import com.ym.utils.DateTimeUtils;
 import com.ym.utils.IdentifierUtils;
 import com.ym.whiteboard.WhiteBoardHelper;
-import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
@@ -75,9 +75,11 @@ import static com.ym.enums.RoleEnum.RoleTeacher;
 /**
  * Created by super_zou on 2019/11/28.
  */
-@Slf4j
 @Service
 public class RoomServiceImpl implements RoomService {
+
+    private final static Logger businessLogger = LoggerFactory.getLogger(RoomServiceImpl.class);
+
     @Autowired
     private IMHelper imHelper;
     @Autowired
@@ -87,8 +89,6 @@ public class RoomServiceImpl implements RoomService {
     @Autowired
     private RoomMemberDao roomMemberDao;
     @Autowired
-    private RoomMemberService roomMemberService;
-    @Autowired
     private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
     @Autowired
     private WhiteBoardHelper whiteBoardHelper;
@@ -191,7 +191,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         String userId = sysUser.getId().toString();
-        log.info("joinRoom: roomId={}, userId={}", roomId, userId);
+        businessLogger.info("joinRoom: roomId={}, userId={}", roomId, userId);
 
         Teacher teacher = teacherDao.get(Integer.parseInt(userId));
         CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId));
@@ -246,7 +246,7 @@ public class RoomServiceImpl implements RoomService {
             roomId = "S" + roomId;
         }
         redisTemplate.opsForValue().setIfAbsent(roomId + userId, courseSchedule.getId().toString());
-        log.info("joinRoom current: roomId={}, userId={}", roomId, userId);
+        businessLogger.info("joinRoom current: roomId={}, userId={}", roomId, userId);
 
         // 主讲老师信息
         SysUser teacherInfo = sysUserFeignService.queryUserById(courseSchedule.getActualTeacherId());
@@ -365,7 +365,7 @@ public class RoomServiceImpl implements RoomService {
             genRtcRoomMemberInfoConfig(roomId, joinRoom, sysUser, userId, teacher, schedule, curTime, roomResult, courseId);
         }
 
-        log.info("join room: roomId = {}, userId = {}", roomId, userId);
+        businessLogger.info("join room: roomId = {}, userId = {}", roomId, userId);
         return new BaseResponse(roomResult);
     }
 
@@ -461,7 +461,7 @@ public class RoomServiceImpl implements RoomService {
             schedule.setLiveRoomId(roomUid);
             courseScheduleDao.update(schedule);
         }catch (Exception e) {
-            log.error("创建直播间失败", e);
+            businessLogger.error("创建直播间失败", e);
             liveRoom = imLiveBroadcastRoomService.lambdaQuery()
                     .eq(ImLiveBroadcastRoom::getRoomUid, roomUid)
                     .last("LIMIT 1")
@@ -507,7 +507,7 @@ public class RoomServiceImpl implements RoomService {
         if (member == null) {
             int count = roomMemberDao.countByRidAndExcludeRole(roomId, RoleEnum.RoleAudience.getValue());
             if (count == roomProperties.getMaxCount()) {
-                log.info("join error Over max count: roomId = {}, userId = {}", roomId, userId);
+                businessLogger.info("join error Over max count: roomId = {}, userId = {}", roomId, userId);
                 throw new BizException(ErrorEnum.ERR_OVER_MAX_COUNT.getErrCode(), ErrorEnum.ERR_OVER_MAX_COUNT.getErrMsg());
                 //return new BaseResponse(ErrorEnum.ERR_OVER_MAX_COUNT, ErrorEnum.ERR_OVER_MAX_COUNT.getErrMsg(), null);
             }
@@ -555,7 +555,7 @@ public class RoomServiceImpl implements RoomService {
             try {
                 userSig = pluginService.register(String.valueOf(sysUser.getId()), sysUser.getRealName(), sysUser.getAvatar());
             } catch (Exception e) {
-                log.error("直播房间用户注册失败: userId={}", sysUser.getId(), e);
+                businessLogger.error("直播房间用户注册失败: userId={}", sysUser.getId(), e);
             }
 
             // 返回配置参数
@@ -665,7 +665,7 @@ public class RoomServiceImpl implements RoomService {
         }else {
             roomResult.setRandomNumeric("1");
         }
-        log.info("join room: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId, userName, roleEnum);
+        businessLogger.info("join room: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId, userName, roleEnum);
     }
 
     private void joinImGroup(String roomId, Integer actualTeacherId, CourseSchedule courseSchedule) throws Exception {
@@ -679,7 +679,7 @@ public class RoomServiceImpl implements RoomService {
 
             try {
                 // 创建群组
-                log.info("createImGroup: roomId = {}, userId = {}", roomId, actualTeacherId);
+                businessLogger.info("createImGroup: roomId = {}, userId = {}", roomId, actualTeacherId);
                 if (TencentCloudRTCPlugin.PLUGIN_NAME.equals(pluginService.pluginName())) {
 
 
@@ -707,7 +707,7 @@ public class RoomServiceImpl implements RoomService {
                     }
 
                     // 加入群组成员
-                    log.info("joinImGroup: roomId = {}, serviceProvider={}, userIds = {}", roomId, courseSchedule.getServiceProvider(), groupMembers);
+                    businessLogger.info("joinImGroup: roomId = {}, serviceProvider={}, userIds = {}", roomId, courseSchedule.getServiceProvider(), groupMembers);
                     pluginService.chatRoomGroupJoin(roomId, courseSchedule.getName(), groupMembers);
                 } else {
 
@@ -733,7 +733,7 @@ public class RoomServiceImpl implements RoomService {
 
         CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId);
         if (Objects.isNull(courseSchedule)) {
-            log.warn("createRtcGroup courseSchedule is null: courseScheduleId = {}", courseScheduleId);
+            businessLogger.warn("createRtcGroup courseSchedule is null: courseScheduleId = {}", courseScheduleId);
             return;
         }
 
@@ -744,7 +744,7 @@ public class RoomServiceImpl implements RoomService {
             try {
                 pluginService.register(courseSchedule.getTeacherId().toString(), teacher.getRealName(), teacher.getAvatar());
             } catch (Exception e) {
-                log.error("直播房间群主注册失败: userId={}", courseSchedule.getTeacherId(), e);
+                businessLogger.error("直播房间群主注册失败: userId={}", courseSchedule.getTeacherId(), e);
             }
         }
 
@@ -789,15 +789,15 @@ public class RoomServiceImpl implements RoomService {
                         .groupId(roomId)
                         .appDefinedData(definedDataList)
                         .build());
-                log.info("updateChatRoomGroupData ret={}, roomId={}, definedDataList={}", ret, roomId, definedDataList);
+                businessLogger.info("updateChatRoomGroupData ret={}, roomId={}, definedDataList={}", ret, roomId, definedDataList);
             } catch (Exception e) {
-                log.error("直播网管课自定义字段设置失败: roomId={}", roomId, e);
+                businessLogger.error("直播网管课自定义字段设置失败: roomId={}", roomId, e);
             }
         }
     }
 
     private void dismissImGroup(String userId,String roomId, String serviceProvider) throws Exception {
-        log.info("dismissImGroup: roomId = {}, userId = {}", roomId, userId);
+        businessLogger.info("dismissImGroup: roomId = {}, userId = {}", roomId, userId);
         String joinImGroupKey = "joinImGroup:" + roomId;
         redisTemplate.delete(joinImGroupKey);
 
@@ -853,7 +853,7 @@ public class RoomServiceImpl implements RoomService {
         if (roomMember == null) {
             return;
         }
-        log.info("joinRoomFailure : roomId={}, userId={}", roomId, userId);
+        businessLogger.info("joinRoomFailure : roomId={}, userId={}", roomId, userId);
         //如果加入失败,删除该用户数据
         roomMemberDao.deleteUserByRidAndUid(roomId, userId);
     }
@@ -861,7 +861,7 @@ public class RoomServiceImpl implements RoomService {
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void joinRoomSuccess(String roomId, String userId, String deviceNum) throws Exception {
-        log.info("joinRoomSuccess: roomId={}, userId={}, deviceNum={}", roomId, userId, deviceNum);
+        businessLogger.info("joinRoomSuccess: roomId={}, userId={}, deviceNum={}", roomId, userId, deviceNum);
         RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
         if (roomMember == null) {
             roomMember = saveRoomMember(roomId, userId);
@@ -893,7 +893,7 @@ public class RoomServiceImpl implements RoomService {
             }
             Date curTime = DateTimeUtils.currentUTC();
             Room room = roomDao.findByRid(roomId);
-            log.info("joinRoomSuccess: roomId={}, userId={}, roleEnum={}, room={}", roomId, userId, roleEnum.name(), Objects.isNull(room));
+            businessLogger.info("joinRoomSuccess: roomId={}, userId={}, roleEnum={}, room={}", roomId, userId, roleEnum.name(), Objects.isNull(room));
             if (room == null) {
                 saveRoom(roomId, roomId, curTime, display);
                 this.joinImGroup(roomId, schedule.getActualTeacherId(), schedule);
@@ -977,7 +977,7 @@ public class RoomServiceImpl implements RoomService {
             }
         }
 
-        log.info("join room success: roomId = {}, userId = {}, role = {}", roomId, userId, roleEnum);
+        businessLogger.info("join room success: roomId = {}, userId = {}, role = {}", roomId, userId, roleEnum);
         signInSuccess(roomMember, deviceNum);
     }
 
@@ -991,10 +991,10 @@ public class RoomServiceImpl implements RoomService {
         if (redisTemplate.hasKey(currentRoomIdKey)) {
             currentRoomId = Long.parseLong(redisTemplate.opsForValue().get(currentRoomIdKey));
         } else {
-            log.error("signInFailure: roomId={}, userId={}", roomId, userId);
+            businessLogger.error("signInFailure: roomId={}, userId={}", roomId, userId);
             currentRoomId = firstCourseId;
         }
-        log.info("signInSuccess: roomId={}, userId={},currentRoomId={}", roomId, userId, currentRoomId);
+        businessLogger.info("signInSuccess: roomId={}, userId={},currentRoomId={}", roomId, userId, currentRoomId);
         Integer userIdInt = Integer.parseInt(userId);
 
         RoleEnum roleEnum = RoleEnum.getEnumByValue(roomMember.getRole());
@@ -1044,10 +1044,10 @@ public class RoomServiceImpl implements RoomService {
         // 用户退出房间多次触发调用判定
         RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
         if (Objects.isNull(roomMember)) {
-            log.warn("leaveRoomSuccess: REPEATED_EXECUTION roomId={}, userId={}, deviceNum={}", roomId, userId, deviceNum);
+            businessLogger.warn("leaveRoomSuccess: REPEATED_EXECUTION roomId={}, userId={}, deviceNum={}", roomId, userId, deviceNum);
             return;
         }
-        log.info("leaveRoomSuccess: roomId={}, userId={}, deviceNum={}", roomId, userId, deviceNum);
+        businessLogger.info("leaveRoomSuccess: roomId={}, userId={}, deviceNum={}", roomId, userId, deviceNum);
 
         Integer firstCourseId = Integer.parseInt(roomId.substring(1));
         RoleEnum roleEnum;
@@ -1063,7 +1063,7 @@ public class RoomServiceImpl implements RoomService {
 
         String leaveSuccessKey = "leaveRoomSuccess" + roomId + userId;
         Boolean exist = redisTemplate.opsForValue().setIfAbsent(leaveSuccessKey, roomId, 1L, TimeUnit.SECONDS);
-        log.info("leaveRoomSuccess: roomId={}, userId={},deviceNum={},aBoolean={}", roomId, userId, deviceNum, exist);
+        businessLogger.info("leaveRoomSuccess: roomId={}, userId={},deviceNum={},aBoolean={}", roomId, userId, deviceNum, exist);
         if (Boolean.FALSE.equals(exist)) {
             if (StringUtils.isNotEmpty(deviceNum)) {
                 //如果设备号不为空,更新设备号
@@ -1118,7 +1118,7 @@ public class RoomServiceImpl implements RoomService {
                 //关闭所有曲目播放
                 courseScheduleStudentMusicScoreDao.closePlayStatus(courseSchedule.getId(), null, null);
             }
-            log.info("leaveRoomSuccess dismiss the room: {}, userId: {}, role={}", roomId, userId, roleEnum.name());
+            businessLogger.info("leaveRoomSuccess dismiss the room: {}, userId: {}, role={}", roomId, userId, roleEnum.name());
 
         } else {
             roomMemberDao.deleteUserByRidAndUid(roomId, userId);
@@ -1160,7 +1160,7 @@ public class RoomServiceImpl implements RoomService {
                 }
             }
 
-            log.info("leaveRoomSuccess quit group: roomId={}, userId: {}, roomMembers={}", roomId, userId, roomMembers);
+            businessLogger.info("leaveRoomSuccess quit group: roomId={}, userId: {}, roomMembers={}", roomId, userId, roomMembers);
         }
         userDao.deleteByUid(userId);
     }
@@ -1181,18 +1181,18 @@ public class RoomServiceImpl implements RoomService {
         // 用户退出房间多次触发调用判定
         RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
         if (Objects.isNull(roomMember)) {
-            log.warn("leaveRoomSuccess: REPEATED_EXECUTION roomId={}, userId={}, deviceNum={}", roomId, userId, deviceNum);
+            businessLogger.warn("leaveRoomSuccess: REPEATED_EXECUTION roomId={}, userId={}, deviceNum={}", roomId, userId, deviceNum);
             return;
         }
 
         // 回调整事件延迟通知
         if (callbackTs < roomMember.getJoinDt().getTime()) {
-            log.warn("leaveRoomSuccess: q roomId={}, userId={}, deviceNum={}, callbackTs={}, joinTs={}",
+            businessLogger.warn("leaveRoomSuccess: q roomId={}, userId={}, deviceNum={}, callbackTs={}, joinTs={}",
                     roomId, userId, deviceNum, callbackTs, roomMember.getJoinDt().getTime());
             return;
         }
 
-        log.info("leaveRoomSuccess: roomId={}, userId={}, deviceNum={}, joinTs={}, callbackTs={}", roomId, userId, deviceNum,
+        businessLogger.info("leaveRoomSuccess: roomId={}, userId={}, deviceNum={}, joinTs={}, callbackTs={}", roomId, userId, deviceNum,
                 roomMember.getJoinDt().getTime(), callbackTs);
 
         // 若用户已经离开房间,先添加用户到房间
@@ -1229,12 +1229,12 @@ public class RoomServiceImpl implements RoomService {
                 try {
                     this.dismissImGroup(list.get(0).getUid(), roomId, courseSchedule.getServiceProvider());
                 } catch (Exception e) {
-                    log.error("destroyRoom: {}", e.getMessage());
+                    businessLogger.error("destroyRoom: {}", e.getMessage());
                     e.printStackTrace();
                 }
             }
             roomMemberDao.deleteByRid(roomId);
-            log.info("destroyRoom: {}", roomId);
+            businessLogger.info("destroyRoom: {}", roomId);
         }
     }
 
@@ -1256,7 +1256,7 @@ public class RoomServiceImpl implements RoomService {
             String changedUserId = user.getUserId();
             RoleEnum changedRole = RoleEnum.getEnumByValue(user.getRole());
             if (changedUserId.equals(userId)) {
-                log.error("can not change self role: {}, {}, {}", roomId, userId, changedRole);
+                businessLogger.error("can not change self role: {}, {}, {}", roomId, userId, changedRole);
                 throw new ApiException(ErrorEnum.ERR_CHANGE_SELF_ROLE);
             } else {
                 RoomMember oldUser = roomMemberDao.findByRidAndUid(roomId, changedUserId);
@@ -1269,16 +1269,16 @@ public class RoomServiceImpl implements RoomService {
                             u.setUserName(userInfo.getName());
                         }
                         changedUsers.add(u);
-                        log.info("change the role: {}, {}, {}, result: {}", roomId, userId, changedRole, r);
+                        businessLogger.info("change the role: {}, {}, {}, result: {}", roomId, userId, changedRole, r);
                         result = true;
                     }
                     if (oldUser.getRole() == RoleTeacher.getValue() && isUserDisplay(room, oldUser.getUid())) {
                         updateDisplay(roomId, userId, "", 1);
                     } else {
-                        log.info("don't update display: room={}, userRole={}", room, RoleEnum.getEnumByValue(oldUser.getRole()));
+                        businessLogger.info("don't update display: room={}, userRole={}", room, RoleEnum.getEnumByValue(oldUser.getRole()));
                     }
                 } else {
-                    log.info("role changed fail, not exist: {} - {} - {}", roomId, userId, changedRole);
+                    businessLogger.info("role changed fail, not exist: {} - {} - {}", roomId, userId, changedRole);
                 }
             }
         }
@@ -1297,7 +1297,7 @@ public class RoomServiceImpl implements RoomService {
         String userId = authUser.getId().toString();
         CheckUtils.checkArgument(userId != null, "userId must't be null");
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
-        log.info("kickMember: roomId={}, userId={}", roomId, userId);
+        businessLogger.info("kickMember: roomId={}, userId={}", roomId, userId);
         RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
         if (roomMember == null) {
             return true;
@@ -1364,7 +1364,7 @@ public class RoomServiceImpl implements RoomService {
 
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
-        log.info("display in room: {}, type = {}, uri = {}", roomId, type, uri);
+        businessLogger.info("display in room: {}, type = {}, uri = {}", roomId, type, uri);
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(type >= 0 && type < DisplayEnum.values().length, "type not exist");
         DisplayEnum displayEnum = DisplayEnum.values()[type];
@@ -1403,7 +1403,7 @@ public class RoomServiceImpl implements RoomService {
                     DisplayMessage displayMessage = new DisplayMessage(display);
                     imHelper.publishMessage(userId, roomId, displayMessage);
                 }
-                log.info("change display to teacher: roomId={}, display={}", roomId, display);
+                businessLogger.info("change display to teacher: roomId={}, display={}", roomId, display);
 
             }
         } else if (displayEnum.equals(DisplayEnum.Assistant)) {
@@ -1420,7 +1420,7 @@ public class RoomServiceImpl implements RoomService {
                     DisplayMessage displayMessage = new DisplayMessage(display);
                     imHelper.publishMessage(userId, roomId, displayMessage);
                 }
-                log.info("change display to assistant: roomId={}, display={}", roomId, display);
+                businessLogger.info("change display to assistant: roomId={}, display={}", roomId, display);
             }
         } else if (displayEnum.equals(DisplayEnum.Screen)) {
             display += "?userId=" + userId + "?uri=";
@@ -1432,7 +1432,7 @@ public class RoomServiceImpl implements RoomService {
                 DisplayMessage displayMessage = new DisplayMessage(display);
                 imHelper.publishMessage(userId, roomId, displayMessage);
             }
-            log.info("change display to screen: roomId={}, display={}", roomId, display);
+            businessLogger.info("change display to screen: roomId={}, display={}", roomId, display);
         } else if (displayEnum.equals(DisplayEnum.STUDENT)) {
             display += "?userId=" + targetUserId + "?uri=" + uri;
             roomDao.updateDisplayByRid(roomId, display);
@@ -1443,7 +1443,7 @@ public class RoomServiceImpl implements RoomService {
                 DisplayMessage displayMessage = new DisplayMessage(display);
                 imHelper.publishMessage(userId, roomId, displayMessage);
             }
-            log.info("change display to screen: roomId={}, display={}", roomId, display);
+            businessLogger.info("change display to screen: roomId={}, display={}", roomId, display);
         } else {
             display += "?userId=" + userId + "?uri=" + uri;
 //            CheckUtils.checkArgument(uri != null, "uri must't be null");
@@ -1457,7 +1457,7 @@ public class RoomServiceImpl implements RoomService {
                 imHelper.publishMessage(userId, roomId, displayMessage);
             }
         }
-        log.info("result display in room: {}, type = {}, uri = {}", roomId, type, uri);
+        businessLogger.info("result display in room: {}, type = {}, uri = {}", roomId, type, uri);
         return true;
     }
 
@@ -1503,7 +1503,7 @@ public class RoomServiceImpl implements RoomService {
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
 
-        log.info("createWhiteBoard: roomId = {}", roomId);
+        businessLogger.info("createWhiteBoard: roomId = {}", roomId);
 
         String wbRoom = IdentifierUtils.uuid();
         WhiteBoardApiResultInfo resultInfo = whiteBoardHelper.create(wbRoom);
@@ -1561,12 +1561,12 @@ public class RoomServiceImpl implements RoomService {
         Room room = roomDao.findByRid(roomId);
         CheckUtils.checkArgument(room != null, "room not exist");
 
-        log.info("deleteWhiteboard: room={}, whiteBoardId={}", room, whiteBoardId);
+        businessLogger.info("deleteWhiteboard: room={}, whiteBoardId={}", room, whiteBoardId);
 
         String display = room.getDisplay();
         if (display.contains("uri=" + whiteBoardId)) {
             int result = roomDao.updateDisplayByRid(roomId, "");
-            log.info("clear room display, room: {}, result: {}", roomId, result);
+            businessLogger.info("clear room display, room: {}, result: {}", roomId, result);
 
             RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
 
@@ -1579,14 +1579,14 @@ public class RoomServiceImpl implements RoomService {
                 imHelper.publishMessage(userId, roomId, displayMessage, 1);
             }
         } else {
-            log.info("no display to clean: room={}", room);
+            businessLogger.info("no display to clean: room={}", room);
         }
 
         String wbRoom = whiteboardList.get(0).getWbRoom();
         WhiteBoardApiResultInfo resultInfo = whiteBoardHelper.destroy(wbRoom);
         if (resultInfo.isSuccess()) {
             int result = whiteboardDao.deleteByWbid(whiteBoardId);
-            log.info("delete whiteboard: roomId = {}, whiteBoardId = {}, result = {}", roomId, whiteBoardId, result);
+            businessLogger.info("delete whiteboard: roomId = {}, whiteBoardId = {}, result = {}", roomId, whiteBoardId, result);
             WhiteboardMessage wbmsg = new WhiteboardMessage(WhiteboardMessage.Delete);
             wbmsg.setWhiteboardId(whiteBoardId);
             imHelper.publishMessage(userId, roomId, wbmsg, 1);
@@ -1625,7 +1625,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(room != null, "room not exist");
 
         int result = whiteboardDao.updatePageByRidAndWbid(roomId, whiteBoardId, page);
-        log.info("turn page to: {}, room: {}, wb : {}; r: {}", page, roomId, whiteBoardId, result);
+        businessLogger.info("turn page to: {}, room: {}, wb : {}; r: {}", page, roomId, whiteBoardId, result);
 
         TurnPageMessage turnPageMessage = new TurnPageMessage(whiteBoardId, userId, page);
         imHelper.publishMessage(userId, roomId, turnPageMessage);
@@ -1692,7 +1692,7 @@ public class RoomServiceImpl implements RoomService {
             throw new ApiException(ErrorEnum.ERR_REQUEST_PARA_ERR);
         }
         SysUser authUser = sysUserFeignService.queryUserInfo();
-        log.info("controlDevice: userId = {}, typeEnum = {}, enable = {} ,roomId = {}", userId, typeEnum, enable, roomId);
+        businessLogger.info("controlDevice: userId = {}, typeEnum = {}, enable = {} ,roomId = {}", userId, typeEnum, enable, roomId);
 
         // RTC服务对象
         RTCRoomPluginService pluginService = rtcRoomPluginContext.getPluginService(data.getServiceProvider());
@@ -1969,7 +1969,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
-        log.info("approveControlDevice: ticket={}", ticket);
+        businessLogger.info("approveControlDevice: ticket={}", ticket);
         ControlDeviceTaskInfo taskInfo = (ControlDeviceTaskInfo) scheduleManager.executeTask(ticket);
         if (taskInfo.getTypeEnum().equals(DeviceTypeEnum.Camera)) {
             roomMemberDao.updateCameraByRidAndUid(roomId, userId, taskInfo.isOnOff());
@@ -2053,7 +2053,7 @@ public class RoomServiceImpl implements RoomService {
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
 
-        log.info("rejectControlDevice: ticket={}", ticket);
+        businessLogger.info("rejectControlDevice: ticket={}", ticket);
         ControlDeviceTaskInfo taskInfo = (ControlDeviceTaskInfo) scheduleManager.executeTask(ticket);
         ControlDeviceNotifyMessage msg = new ControlDeviceNotifyMessage(ActionEnum.Reject.ordinal());
         msg.setType(taskInfo.getTypeEnum().ordinal());
@@ -2182,7 +2182,7 @@ public class RoomServiceImpl implements RoomService {
             imHelper.publishMessage(userId, roomId, deviceResourceMessage, 1);
         }
 
-        log.info("syncDeviceState : {}, {}", roomId, enable);
+        businessLogger.info("syncDeviceState : {}, {}", roomId, enable);
         return true;
     }
 
@@ -2252,14 +2252,14 @@ public class RoomServiceImpl implements RoomService {
         scheduledTaskInfo.setTargetUserId(assistants.get(0).getUid());
         scheduleManager.addTask(scheduledTaskInfo);
 
-        log.info("applySpeech: task = {}", scheduledTaskInfo);
+        businessLogger.info("applySpeech: task = {}", scheduledTaskInfo);
 
         ApplyForSpeechMessage msg = new ApplyForSpeechMessage();
         msg.setTicket(ticket);
         msg.setReqUserId(userId);
         IMApiResultInfo resultInfo = imHelper.publishMessage(userId, assistants.get(0).getUid(), roomId, msg);
 
-        log.info("apply for speech: {}, task = {}", roomId, scheduledTaskInfo);
+        businessLogger.info("apply for speech: {}, task = {}", roomId, scheduledTaskInfo);
         if (resultInfo.isSuccess()) {
             return true;
         } else {
@@ -2277,12 +2277,12 @@ public class RoomServiceImpl implements RoomService {
 
         int count = roomMemberDao.countByRidAndExcludeRole(roomId, RoleEnum.RoleAudience.getValue());
         if (count == roomProperties.getMaxCount()) {
-            log.error("approveSpeech error: roomId = {}, ticket={}", roomId, ticket);
+            businessLogger.error("approveSpeech error: roomId = {}, ticket={}", roomId, ticket);
             throw new ApiException(ErrorEnum.ERR_OVER_MAX_COUNT);
         }
 
         ScheduledTaskInfo taskInfo = scheduleManager.executeTask(ticket);
-        log.info("approveSpeech: task = {}", taskInfo);
+        businessLogger.info("approveSpeech: task = {}", taskInfo);
         roomMemberDao.updateRoleByRidAndUid(roomId, taskInfo.getApplyUserId(), RoleStudent.getValue());
 
         SpeechResultMessage msg = new SpeechResultMessage(SpeechResultMessage.Action_Approve);
@@ -2321,7 +2321,7 @@ public class RoomServiceImpl implements RoomService {
         String userId = authUser.getId().toString();
         ScheduledTaskInfo taskInfo = scheduleManager.executeTask(ticket);
 
-        log.info("rejectSpeech: task = {}", taskInfo);
+        businessLogger.info("rejectSpeech: task = {}", taskInfo);
         SpeechResultMessage msg = new SpeechResultMessage(SpeechResultMessage.Action_Reject);
         msg.setOpUserId(userId);
         msg.setOpUserName(authUser.getUsername());
@@ -2338,7 +2338,7 @@ public class RoomServiceImpl implements RoomService {
         if (RoleEnum.getEnumByValue(targetUser.getRole()).equals(RoleEnum.RoleAudience)) {
             int count = roomMemberDao.countByRidAndExcludeRole(roomId, RoleEnum.RoleAudience.getValue());
             if (count == roomProperties.getMaxCount()) {
-                log.error("assign error: roomId = {}, userId = {}, role = {}", roomId, targetUser.getRid(), targetUser.getRole());
+                businessLogger.error("assign error: roomId = {}, userId = {}, role = {}", roomId, targetUser.getRid(), targetUser.getRole());
                 throw new ApiException(ErrorEnum.ERR_OVER_MAX_COUNT);
             }
         } else if (targetRole > targetUser.getRole()) {
@@ -2353,23 +2353,23 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(userId != null, "userId must't be null");
         CheckUtils.checkArgument(!userId.equals(userId), "can't set self role");
 
-        log.info("transfer: roomId = {}, userId = {}", roomId, userId);
+        businessLogger.info("transfer: roomId = {}, userId = {}", roomId, userId);
         RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
         if (roomMember == null) {
-            log.error("assistant transfer error: {} toUser = {}, opUser={}", roomId, userId, userId);
+            businessLogger.error("assistant transfer error: {} toUser = {}, opUser={}", roomId, userId, userId);
             throw new ApiException(ErrorEnum.ERR_USER_NOT_EXIST_IN_ROOM);
         }
 
         Room room = roomDao.findByRid(roomId);
         if (room == null) {
-            log.error("assistant transfer error: {} toUser = {}, opUser={}", roomId, userId, userId);
+            businessLogger.error("assistant transfer error: {} toUser = {}, opUser={}", roomId, userId, userId);
             throw new ApiException(ErrorEnum.ERR_ROOM_NOT_EXIST);
         }
 
         if (isUserDisplay(room, userId) || isUserDisplay(room, userId)) {
             updateDisplay(roomId, userId, "", 1);
         } else {
-            log.info("don't update display: room={}", room);
+            businessLogger.info("don't update display: room={}", room);
         }
 
         roomMemberDao.updateRoleByRidAndUid(roomId, userId, RoleStudent.getValue());
@@ -2394,7 +2394,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(roomMemberDao.existsByRidAndUid(roomId, targetUserId), "room member not exist");
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
-        log.info("inviteUpgradeRole roomId = {}, targetUserId = {}, targetRole = {}", roomId, targetUserId, targetRole);
+        businessLogger.info("inviteUpgradeRole roomId = {}, targetUserId = {}, targetRole = {}", roomId, targetUserId, targetRole);
 
         RoomMember targetUser = roomMemberDao.findByRidAndUid(roomId, targetUserId);
         if (targetUser == null) {
@@ -2435,7 +2435,7 @@ public class RoomServiceImpl implements RoomService {
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         UpgradeRoleTaskInfo taskInfo = (UpgradeRoleTaskInfo) scheduleManager.executeTask(ticket);
-        log.info("approveUpgradeRole roomId = {}, task={}", roomId, taskInfo);
+        businessLogger.info("approveUpgradeRole roomId = {}, task={}", roomId, taskInfo);
 
         RoomMember targetUser = roomMemberDao.findByRidAndUid(roomId, userId);
         if (targetUser == null) {
@@ -2507,12 +2507,12 @@ public class RoomServiceImpl implements RoomService {
             throw new ApiException(ErrorEnum.ERR_USER_NOT_EXIST_IN_ROOM);
         } else {
             if (!RoleEnum.getEnumByValue(targetUser.getRole()).equals(RoleStudent)) {
-                log.error("change role error: targetUserId={}, targetRole = {}", targetUser, RoleEnum.getEnumByValue(targetRole));
+                businessLogger.error("change role error: targetUserId={}, targetRole = {}", targetUser, RoleEnum.getEnumByValue(targetRole));
                 throw new ApiException(ErrorEnum.ERR_CHANGE_ROLE);
             }
         }
 
-        log.info("changeRole: roomId={}, targetUserId={}", roomId, targetUserId);
+        businessLogger.info("changeRole: roomId={}, targetUserId={}", roomId, targetUserId);
         List<RoleChangedMessage.ChangedUser> changedUserList = new ArrayList<>();
         RoleChangedMessage msg = new RoleChangedMessage(userId);
 
@@ -2526,7 +2526,7 @@ public class RoomServiceImpl implements RoomService {
             }
             changedUserList.add(user);
         } else {
-            log.info("change directly cause no teacher exist in room, roomId={}", roomId);
+            businessLogger.info("change directly cause no teacher exist in room, roomId={}", roomId);
         }
 
         roomMemberDao.updateRoleByRidAndUid(roomId, targetUserId, targetRole);
@@ -2552,7 +2552,7 @@ public class RoomServiceImpl implements RoomService {
             DisplayMessage displayMessage = new DisplayMessage(display);
             imHelper.publishMessage(userId, roomId, displayMessage, 1);
         }
-        log.info("changeRole, display changed: roomId={}, {}, targetUserId={}", roomId, display, targetUserId);
+        businessLogger.info("changeRole, display changed: roomId={}, {}, targetUserId={}", roomId, display, targetUserId);
 
         return true;
     }
@@ -2563,7 +2563,7 @@ public class RoomServiceImpl implements RoomService {
         String sign = imProperties.getSecret() + nonce + timestamp;
         String signSHA1 = CodeUtil.hexSHA1(sign);
         if (!signSHA1.equals(signature)) {
-            log.info("memberOnlineStatus signature error");
+            businessLogger.info("memberOnlineStatus signature error");
             return true;
         }
 
@@ -2571,7 +2571,7 @@ public class RoomServiceImpl implements RoomService {
             int s = Integer.parseInt(status.getStatus());
             String userId = status.getUserId();
 
-            log.info("memberOnlineStatus, userId={}, status={}", userId, status);
+            businessLogger.info("memberOnlineStatus, userId={}, status={}", userId, status);
             //1:offline 离线; 0: online 在线
             if (s == 1) {
                 List<RoomMember> members = roomMemberDao.findByUid(userId);
@@ -2604,7 +2604,7 @@ public class RoomServiceImpl implements RoomService {
 
         for (RoomMember member : members) {
             int userRole = member.getRole();
-            log.info("userIMOfflineKick: roomId={}, {}, role={}", member.getRid(), userId, RoleEnum.getEnumByValue(userRole));
+            businessLogger.info("userIMOfflineKick: roomId={}, {}, role={}", member.getRid(), userId, RoleEnum.getEnumByValue(userRole));
             try {
                 if (userRole == RoleTeacher.getValue() || userRole == RoleEnum.RoleAssistant.getValue()) {
                     Room room = roomDao.findByRid(member.getRid());
@@ -2613,7 +2613,7 @@ public class RoomServiceImpl implements RoomService {
                     }
                     if (isUserDisplay(room, member.getUid())) {
                         updateDisplay(member.getRid(), member.getUid(), "", 0);
-                        log.info("memberOnlineStatus offline: roomId={}, {}", member.getRid(), member.getUid());
+                        businessLogger.info("memberOnlineStatus offline: roomId={}, {}", member.getRid(), member.getUid());
                     }
                 }
                 if (roomMemberDao.countByRid(member.getRid()) == 1) {
@@ -2624,7 +2624,7 @@ public class RoomServiceImpl implements RoomService {
                     roomMemberDao.deleteUserByRidAndUid(member.getRid(), member.getUid());
                     roomDao.deleteByRid(member.getRid());
                     deleteWhiteboardByUser(member.getRid(), member.getUid());
-                    log.info("dismiss the room: {},userId: {}", member.getRid(), userId);
+                    businessLogger.info("dismiss the room: {},userId: {}", member.getRid(), userId);
                 } else {
                     roomMemberDao.deleteUserByRidAndUid(member.getRid(), member.getUid());
                     MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, member.getUid(), userRole);
@@ -2640,7 +2640,7 @@ public class RoomServiceImpl implements RoomService {
                 }
                 userDao.deleteByUid(member.getUid());
             } catch (Exception e) {
-                log.error("userIMOfflineKick error: userId={}", userId);
+                businessLogger.error("userIMOfflineKick error: userId={}", userId);
             }
         }
     }