|
@@ -1,7 +1,6 @@
|
|
|
package cn.reghao.bnt.agent.service;
|
|
package cn.reghao.bnt.agent.service;
|
|
|
|
|
|
|
|
import cn.reghao.bnt.agent.ws.WsClient;
|
|
import cn.reghao.bnt.agent.ws.WsClient;
|
|
|
-import cn.reghao.jutil.jdk.converter.DateTimeConverter;
|
|
|
|
|
import cn.reghao.jutil.jdk.io.TextFile;
|
|
import cn.reghao.jutil.jdk.io.TextFile;
|
|
|
import cn.reghao.jutil.jdk.serializer.JsonConverter;
|
|
import cn.reghao.jutil.jdk.serializer.JsonConverter;
|
|
|
import cn.reghao.jutil.jdk.web.log.NginxLog;
|
|
import cn.reghao.jutil.jdk.web.log.NginxLog;
|
|
@@ -11,7 +10,6 @@ import java.io.File;
|
|
|
import java.io.FileNotFoundException;
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.io.RandomAccessFile;
|
|
import java.io.RandomAccessFile;
|
|
|
-import java.time.LocalDateTime;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -89,9 +87,6 @@ public class TailReader implements Runnable {
|
|
|
private void parseAndPersist(String line, File errLogFile) {
|
|
private void parseAndPersist(String line, File errLogFile) {
|
|
|
try {
|
|
try {
|
|
|
NginxLog nginxLog = JsonConverter.jsonToObject(line, NginxLog.class);
|
|
NginxLog nginxLog = JsonConverter.jsonToObject(line, NginxLog.class);
|
|
|
- LocalDateTime localDateTime = DateTimeConverter.localDateTime(nginxLog.getTimeIso8601());
|
|
|
|
|
- long timestamp = DateTimeConverter.msTimestamp(localDateTime);
|
|
|
|
|
- nginxLog.setRequestTimestamp(timestamp);
|
|
|
|
|
wsClient.send("", nginxLog);
|
|
wsClient.send("", nginxLog);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|