|
|
@@ -1,4 +1,4 @@
|
|
|
-package com.nb.framework.logback;
|
|
|
+package com.nb.common.log;
|
|
|
|
|
|
import ch.qos.logback.classic.Level;
|
|
|
import ch.qos.logback.classic.spi.ILoggingEvent;
|
|
|
@@ -8,10 +8,8 @@ import ch.qos.logback.classic.spi.ThrowableProxyUtil;
|
|
|
import ch.qos.logback.core.CoreConstants;
|
|
|
import ch.qos.logback.core.UnsynchronizedAppenderBase;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
-import com.nb.common.notice.msg.ErrorMsg;
|
|
|
-import com.nb.common.notice.wechat.EnterpriseWeChatNotify;
|
|
|
-import com.nb.system.entity.SysRunningLog;
|
|
|
-import com.nb.system.mapper.SysRunningLogMapper;
|
|
|
+import com.nb.common.log.entity.SysRunningLog;
|
|
|
+import com.nb.common.log.mapper.SysRunningLogMapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import java.util.*;
|
|
|
@@ -21,7 +19,7 @@ public class SystemLoggingAppender extends UnsynchronizedAppenderBase<ILoggingEv
|
|
|
|
|
|
private SysRunningLogMapper logMapper=null;
|
|
|
|
|
|
- private EnterpriseWeChatNotify notify=null;
|
|
|
+// private EnterpriseWeChatNotify notify=null;
|
|
|
@Override
|
|
|
protected void append(ILoggingEvent event) {
|
|
|
init();
|
|
|
@@ -66,9 +64,9 @@ public class SystemLoggingAppender extends UnsynchronizedAppenderBase<ILoggingEv
|
|
|
.threadId(String.valueOf(Thread.currentThread().getId()))
|
|
|
.build();
|
|
|
if (Level.ERROR.equals(event.getLevel())) {
|
|
|
- if(notify!=null){
|
|
|
- notify.send( ErrorMsg.of(message));
|
|
|
- }
|
|
|
+// if(notify!=null){
|
|
|
+// notify.send( ErrorMsg.of(message));
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
logMapper.insert(info);
|
|
|
@@ -78,8 +76,8 @@ public class SystemLoggingAppender extends UnsynchronizedAppenderBase<ILoggingEv
|
|
|
if(logMapper==null){
|
|
|
logMapper= SpringUtil.getBean(SysRunningLogMapper.class);
|
|
|
}
|
|
|
- if(notify==null){
|
|
|
- notify= SpringUtil.getBean(EnterpriseWeChatNotify.class);
|
|
|
- }
|
|
|
+// if(notify==null){
|
|
|
+// notify= SpringUtil.getBean(EnterpriseWeChatNotify.class);
|
|
|
+// }
|
|
|
}
|
|
|
}
|