|
@@ -2,6 +2,7 @@ package com.xy.utils;
|
|
|
|
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONObject;
|
|
import com.xy.config.SpringConfigs;
|
|
import com.xy.config.SpringConfigs;
|
|
|
|
+import com.xy.entity.SysCodeConfigureRedis;
|
|
import com.xy.enums.LogEnum;
|
|
import com.xy.enums.LogEnum;
|
|
import com.xy.producer.LogsProducer;
|
|
import com.xy.producer.LogsProducer;
|
|
import com.xy.producer.LogsProducerConfiguration;
|
|
import com.xy.producer.LogsProducerConfiguration;
|
|
@@ -57,14 +58,19 @@ public class LogUtils {
|
|
/**
|
|
/**
|
|
* 系统事件
|
|
* 系统事件
|
|
*
|
|
*
|
|
|
|
+ * @param code 事件编码
|
|
* @param eventName 事件名称
|
|
* @param eventName 事件名称
|
|
- * @param eventLevel 事件等级
|
|
|
|
* @param eventDescript 事件描述
|
|
* @param eventDescript 事件描述
|
|
*/
|
|
*/
|
|
- public static void events(String eventName, LogEnum.EventLevel eventLevel, String eventDescript) {
|
|
|
|
|
|
+ public static void events(String code, String eventName, String eventDescript) {
|
|
|
|
+ String paterCode = code.substring(0, code.length() - 1);
|
|
|
|
+ SysCodeConfigureRedis sysCodeConfigureRedis = SysCodeConfigureUtils.get(paterCode, code);
|
|
|
|
+ Integer port = SpringBeanUtils.getBean("getPort", Integer.class);
|
|
JSONObject jsonObject = new JSONObject()
|
|
JSONObject jsonObject = new JSONObject()
|
|
|
|
+ .set("code", code)
|
|
|
|
+ .set("port", port)
|
|
.set("eventName", eventName)
|
|
.set("eventName", eventName)
|
|
- .set("eventLevel", eventLevel.getValue())
|
|
|
|
|
|
+ .set("eventLevel", sysCodeConfigureRedis.getExpand())
|
|
.set("eventDescript", eventDescript)
|
|
.set("eventDescript", eventDescript)
|
|
.set("serviceName", springConfigs.getApplication().getName())
|
|
.set("serviceName", springConfigs.getApplication().getName())
|
|
.set("createTime", DataTime.getSring())
|
|
.set("createTime", DataTime.getSring())
|