Browse Source

优化日志获取

hl 7 months ago
parent
commit
2e1937012d
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/utils/file.js
  2. 1 1
      src/web.js

+ 1 - 1
src/utils/file.js

@@ -149,7 +149,7 @@ async function readLastNLines(dirPath, filePathList, n) {
                 lines: lines,
             })
             count += lines.length;
-            if (count > n) {
+            if (count >= n) {
                 break
             }
         }

+ 1 - 1
src/web.js

@@ -90,7 +90,7 @@ function init() {
             try {
                 file.checkPathSync(directoryPath)
 
-                   file.getLastFile(logPath, 5,  async (fileNameList, _) => {
+                   file.getLastFile(logPath, 500,  async (fileNameList, _) => {
                        // logger.info('文件:', fileNameList);
                        result = await file.readLastNLines(logPath, fileNameList, n);
                        // logger.info('?????:', result);