|
@@ -0,0 +1,128 @@
|
|
|
+package cn.gygxzc.tina.cloud.bus.message;
|
|
|
+
|
|
|
+import ch.qos.logback.classic.spi.ILoggingEvent;
|
|
|
+import cn.gygxzc.tina.cloud.bus.utils.GsonUtils;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Created by niantuo on 2018/11/5.
|
|
|
+ * 分布式日志记录
|
|
|
+ */
|
|
|
+
|
|
|
+public class LogMessage {
|
|
|
+
|
|
|
+ private String sysName;
|
|
|
+ private String threadName;
|
|
|
+ private String level;
|
|
|
+ private String message;
|
|
|
+ private String arguments;
|
|
|
+ private String formattedMessage;
|
|
|
+ private String loggerName;
|
|
|
+ private String callerData;
|
|
|
+ private String marker;
|
|
|
+ private String propertyMap;
|
|
|
+ private Long timeStamp;
|
|
|
+
|
|
|
+ public LogMessage(ILoggingEvent event,String name) {
|
|
|
+ this.sysName = name;
|
|
|
+ this.threadName = event.getThreadName();
|
|
|
+ level = event.getLevel().levelStr;
|
|
|
+ message = event.getMessage();
|
|
|
+ arguments = GsonUtils.toJson(event.getArgumentArray());
|
|
|
+ formattedMessage = event.getFormattedMessage();
|
|
|
+ loggerName = event.getLoggerName();
|
|
|
+ callerData = GsonUtils.toJson(event.getCallerData());
|
|
|
+ marker = GsonUtils.toJson(event.getMarker());
|
|
|
+ propertyMap = GsonUtils.toJson(event.getMDCPropertyMap());
|
|
|
+ timeStamp = event.getTimeStamp();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setSysName(String sysName) {
|
|
|
+ this.sysName = sysName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getSysName() {
|
|
|
+ return sysName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getThreadName() {
|
|
|
+ return threadName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setThreadName(String threadName) {
|
|
|
+ this.threadName = threadName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getLevel() {
|
|
|
+ return level;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLevel(String level) {
|
|
|
+ this.level = level;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getMessage() {
|
|
|
+ return message;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMessage(String message) {
|
|
|
+ this.message = message;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getArguments() {
|
|
|
+ return arguments;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setArguments(String arguments) {
|
|
|
+ this.arguments = arguments;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getFormattedMessage() {
|
|
|
+ return formattedMessage;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setFormattedMessage(String formattedMessage) {
|
|
|
+ this.formattedMessage = formattedMessage;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getLoggerName() {
|
|
|
+ return loggerName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLoggerName(String loggerName) {
|
|
|
+ this.loggerName = loggerName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getCallerData() {
|
|
|
+ return callerData;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setCallerData(String callerData) {
|
|
|
+ this.callerData = callerData;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getMarker() {
|
|
|
+ return marker;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMarker(String marker) {
|
|
|
+ this.marker = marker;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPropertyMap() {
|
|
|
+ return propertyMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPropertyMap(String propertyMap) {
|
|
|
+ this.propertyMap = propertyMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getTimeStamp() {
|
|
|
+ return timeStamp;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setTimeStamp(Long timeStamp) {
|
|
|
+ this.timeStamp = timeStamp;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|