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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user