feat(frpLogger): add real-time instance log streaming functionality

Implement cross-platform log streaming for frpc instances with support for Windows, systemd, and init.d systems. Includes WebSocket API endpoint for real-time log streaming, token validation, and instance ownership checks. Update README and API documentation to reflect new functionality.

The implementation handles:
- Platform-specific log collection (Windows Event Log, journalctl, log files)
- WebSocket-based real-time streaming
- Token validation and instance access control
- Log level parsing and formatting
- Historical log retrieval since service start
This commit is contained in:
2026-03-26 17:46:50 +08:00
parent 61e4ad6ecc
commit 839bad3c94
11 changed files with 1658 additions and 7 deletions
+4
View File
@@ -6,6 +6,7 @@ import (
"net/http"
"os"
"os/signal"
"super-frpc/frpLogger"
"super-frpc/postLog"
"syscall"
"time"
@@ -77,6 +78,9 @@ func main() {
postLog.Warning(fmt.Sprintf("Failed to initialize frpc database: %v", err))
}
frpLogger.SetDatabase(db, frpcDB)
frpLogger.SetDebugMode(config.Debug)
_, err = GetConfig()
if err != nil {
postLog.Fatal(fmt.Sprintf("Failed to get config: %v", err))