|
|
@@ -1,27 +1,13 @@
|
|
|
import Utils.LogBuilder;
|
|
|
-import Utils.PostHelper;
|
|
|
import client.LogTrackingClient;
|
|
|
import com.nju.edu.logTracking.LogConsumer;
|
|
|
-import com.nju.edu.logTracking.dto.LogConfigDto;
|
|
|
-import com.nju.edu.logTracking.enums.Level;
|
|
|
-import com.nju.edu.logTracking.enums.PublishMode;
|
|
|
import com.nju.edu.logTracking.enums.SeecSystem;
|
|
|
-import com.nju.edu.logTracking.kafka.Config;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
public class Test {
|
|
|
public static void main(String[] args) throws IOException {
|
|
|
- LogConfigDto logConfigDto = new LogConfigDto(
|
|
|
- Level.MEDIUM.getValue(),
|
|
|
- PublishMode.SINGLE.getValue(),
|
|
|
- "");
|
|
|
- String result = PostHelper.post(Config.SERVER + "/api/publish", logConfigDto);
|
|
|
- System.out.println(result);
|
|
|
String data = "This is an example";
|
|
|
-
|
|
|
- //此为logBuilder,若不想使用也可自己构建log
|
|
|
- //注:此logBuilder在调用build方法时会自动添加created_time属性,值为当前时间戳
|
|
|
String log = LogBuilder
|
|
|
.getBuilder()
|
|
|
.target(SeecSystem.EVAL.getName())
|