Commit cf5f6295 authored by fangxinjiang's avatar fangxinjiang

nginxlog 写入数据库服务

parent 121ba2a6
...@@ -286,7 +286,7 @@ public class NginxLogServiceImpl extends ServiceImpl<NginxLogMapper, NginxLog> i ...@@ -286,7 +286,7 @@ public class NginxLogServiceImpl extends ServiceImpl<NginxLogMapper, NginxLog> i
try { try {
// 读取JSON日志文件 // 读取JSON日志文件
//fis = new FileInputStream("C:\\nginx.log"); //fis = new FileInputStream("C:\\nginx.log");
fis = new FileInputStream("/root/install/nginx/logs/nginx-log"+DateUtil.dateIncreaseByHour(new Date(),0,DateUtil.DATETIME_PATTERN_HOUR)+".log"); fis = new FileInputStream("/root/install/nginx/logs/nginx-log-"+DateUtil.dateIncreaseByHour(new Date(),0,DateUtil.DATETIME_PATTERN_HOUR)+".log");
br = new BufferedReader(new InputStreamReader(fis)); br = new BufferedReader(new InputStreamReader(fis));
String line; String line;
while ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) {
......
...@@ -60,6 +60,6 @@ springdoc: ...@@ -60,6 +60,6 @@ springdoc:
#按路径匹配 #按路径匹配
# pathsToMatch: /admin/** # pathsToMatch: /admin/**
#分组名 #分组名
- group: checks - group: nginx-log
#按包路径匹配 #按包路径匹配
packagesToScan: com.yifu.cloud.plus.v1.nginx.controller packagesToScan: com.yifu.cloud.plus.v1.nginx.controller
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment