|
@@ -21,7 +21,7 @@ public class LogTracingUtil {
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerUtil.getLogger(LogTracingUtil.class);
|
|
private static final Logger logger = LoggerUtil.getLogger(LogTracingUtil.class);
|
|
|
|
|
|
|
|
- public static void logToAnalysis(String data, int type) {
|
|
|
|
|
|
|
+ public static void logToAnalysis(String data, int type, String message) {
|
|
|
// String data = "This is an example";
|
|
// String data = "This is an example";
|
|
|
|
|
|
|
|
//此为logBuilder,若不想使用也可自己构建log
|
|
//此为logBuilder,若不想使用也可自己构建log
|
|
@@ -32,11 +32,11 @@ public class LogTracingUtil {
|
|
|
try {
|
|
try {
|
|
|
logData= LogBuilder
|
|
logData= LogBuilder
|
|
|
.getBuilder()
|
|
.getBuilder()
|
|
|
- .target("smart") // 等待分配enum后修改
|
|
|
|
|
- .source(SeecSystem.EVAL.getName())
|
|
|
|
|
|
|
+ .target(SeecSystem.SMART) // 等待分配enum后修改
|
|
|
|
|
+ .source(SeecSystem.EVAL)
|
|
|
.operationType(type)
|
|
.operationType(type)
|
|
|
.data(data)
|
|
.data(data)
|
|
|
- .message("OK")
|
|
|
|
|
|
|
+ .message(message)
|
|
|
.build();
|
|
.build();
|
|
|
|
|
|
|
|
//最简单使用方法,默认为medium级别
|
|
//最简单使用方法,默认为medium级别
|
|
@@ -62,7 +62,7 @@ public class LogTracingUtil {
|
|
|
|
|
|
|
|
ExamLog examLog = new ExamLog(exam.getId(), totalGrade, answerDTOS, exam.getDifficulty(), new Date(), exam.getStartTime(), exam.getEndTime());
|
|
ExamLog examLog = new ExamLog(exam.getId(), totalGrade, answerDTOS, exam.getDifficulty(), new Date(), exam.getStartTime(), exam.getEndTime());
|
|
|
|
|
|
|
|
- logToAnalysis(JSON.toJSONStringWithDateFormat(examLog, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat), type);
|
|
|
|
|
|
|
+ logToAnalysis(JSON.toJSONStringWithDateFormat(examLog, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat), type, "exam data");
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
System.out.println("构建日志数据失败");
|
|
System.out.println("构建日志数据失败");
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -70,7 +70,7 @@ public class LogTracingUtil {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void logRecord(ExamRecordLog examRecordLog) {
|
|
public static void logRecord(ExamRecordLog examRecordLog) {
|
|
|
- logToAnalysis(JSON.toJSONStringWithDateFormat(examRecordLog, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat), 2);
|
|
|
|
|
|
|
+ logToAnalysis(JSON.toJSONStringWithDateFormat(examRecordLog, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat), 2, "record data");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void logSimple(String log) {
|
|
public static void logSimple(String log) {
|