fix(frpLogger): replace all logs fetching method to read corresponding file in the logsPath

This commit is contained in:
2026-06-06 14:31:42 +08:00
parent 5e9bdf02f9
commit a0634703ea
8 changed files with 113 additions and 1127 deletions
+5 -12
View File
@@ -5,10 +5,13 @@ import (
"fmt"
"log"
"net/http"
"path/filepath"
"strconv"
"sync"
"time"
"super-frpc/global"
"github.com/gorilla/websocket"
)
@@ -86,18 +89,8 @@ func (s *InstanceLogStreamer) streamLogs() {
return
}
initSystem := GetInitSystem()
switch initSystem {
case "windows":
s.streamWindowsLogs()
case "systemd":
s.streamSystemdLogs()
case "init.d":
s.streamInitDLogs()
default:
s.sendError(fmt.Sprintf("Unsupported init system: %s", initSystem))
}
logFilePath := filepath.Join(global.CurrentConfig.LogsPath, fmt.Sprintf("superfrpc_%d.log", s.instanceID))
s.streamLogFile(logFilePath)
}
func (s *InstanceLogStreamer) sendLog(level, content string) {