|
@@ -3,8 +3,8 @@ package com.xy.utils;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import com.xy.config.SpringConfigs;
|
|
|
import com.xy.enums.LogEnum;
|
|
|
-import com.xy.producer.LogProducer;
|
|
|
-import com.xy.producer.LogProducerConfiguration;
|
|
|
+import com.xy.producer.LogsProducer;
|
|
|
+import com.xy.producer.LogsProducerConfiguration;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
@@ -18,7 +18,7 @@ public class LogUtils {
|
|
|
|
|
|
private static SpringConfigs springConfigs;
|
|
|
|
|
|
- private static LogProducer logProducer;
|
|
|
+ private static LogsProducer logsProducer;
|
|
|
|
|
|
@Autowired(required = false)
|
|
|
public void setSpringConfigs(SpringConfigs springConfigs) {
|
|
@@ -26,8 +26,8 @@ public class LogUtils {
|
|
|
}
|
|
|
|
|
|
@Autowired(required = false)
|
|
|
- public void setMqttProducer(LogProducer logProducer) {
|
|
|
- LogUtils.logProducer = logProducer;
|
|
|
+ public void setMqttProducer(LogsProducer logsProducer) {
|
|
|
+ LogUtils.logsProducer = logsProducer;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -51,7 +51,7 @@ public class LogUtils {
|
|
|
.set("clientIp", getIp())
|
|
|
.set("serviceName", springConfigs.getApplication().getName())
|
|
|
.set("type", "operate");
|
|
|
- logProducer.sendToMqtt(jsonObject.toString(), LogProducerConfiguration.TOPIC, 0);
|
|
|
+ logsProducer.sendToMqtt(jsonObject.toString(), LogsProducerConfiguration.TOPIC, 0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -69,7 +69,7 @@ public class LogUtils {
|
|
|
.set("serviceName", springConfigs.getApplication().getName())
|
|
|
.set("createTime", DataTime.getSring())
|
|
|
.set("type", "envents");
|
|
|
- logProducer.sendToMqtt(jsonObject.toString(), LogProducerConfiguration.TOPIC, 0);
|
|
|
+ logsProducer.sendToMqtt(jsonObject.toString(), LogsProducerConfiguration.TOPIC, 0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -89,7 +89,7 @@ public class LogUtils {
|
|
|
.set("serviceName", springConfigs.getApplication().getName())
|
|
|
.set("createTime", DataTime.getSring())
|
|
|
.set("type", "tasks");
|
|
|
- logProducer.sendToMqtt(jsonObject.toString(), LogProducerConfiguration.TOPIC, 0);
|
|
|
+ logsProducer.sendToMqtt(jsonObject.toString(), LogsProducerConfiguration.TOPIC, 0);
|
|
|
}
|
|
|
|
|
|
/**
|