|
@@ -30,6 +30,7 @@ import org.springframework.stereotype.Component;
|
|
|
public class LogEventListenerConfig {
|
|
public class LogEventListenerConfig {
|
|
|
private ISysLogService sysLogService;
|
|
private ISysLogService sysLogService;
|
|
|
private LocalSysRunningLogService sysRunningLogService;
|
|
private LocalSysRunningLogService sysRunningLogService;
|
|
|
|
|
+ @Autowired(required = false)
|
|
|
private EnterpriseWeChatNotify weChatNotify;
|
|
private EnterpriseWeChatNotify weChatNotify;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -51,7 +52,9 @@ public class LogEventListenerConfig {
|
|
|
if(Level.ERROR.levelStr.equals(log.getLevel())){
|
|
if(Level.ERROR.levelStr.equals(log.getLevel())){
|
|
|
SysRunningLog sysLog = BeanUtil.copyProperties(log, SysRunningLog.class);
|
|
SysRunningLog sysLog = BeanUtil.copyProperties(log, SysRunningLog.class);
|
|
|
sysRunningLogService.save(sysLog);
|
|
sysRunningLogService.save(sysLog);
|
|
|
- weChatNotify.send(ErrorMsg.of(log.getExceptionStack()));
|
|
|
|
|
|
|
+ if(weChatNotify!=null){
|
|
|
|
|
+ weChatNotify.send(ErrorMsg.of(log.getExceptionStack()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|