增加edge-node accesslog命令,用来在本地查看访问日志

This commit is contained in:
刘祥超
2022-05-18 23:14:57 +08:00
parent 298cef7f05
commit a9d31a2e35
6 changed files with 187 additions and 3 deletions

View File

@@ -820,6 +820,18 @@ func (this *Node) listenSock() error {
} else {
_ = cmd.ReplyOk()
}
case "accesslog":
err := sharedHTTPAccessLogViewer.Start()
if err != nil {
_ = cmd.Reply(&gosock.Command{
Code: "error",
Params: map[string]interface{}{
"message": "start failed: " + err.Error(),
},
})
} else {
_ = cmd.ReplyOk()
}
}
})