fix(frpLogger): replace all logs fetching method to read corresponding file in the logsPath
This commit is contained in:
+5
-12
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user