From 88d97ebe2558e46345827cdc459d62f0649f6111 Mon Sep 17 00:00:00 2001 From: zhanglei28 Date: Thu, 5 Sep 2024 10:26:22 +0800 Subject: [PATCH] add mport access log --- agent.go | 2 ++ core/motan.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/agent.go b/agent.go index 79e46225..013f08f6 100644 --- a/agent.go +++ b/agent.go @@ -1249,8 +1249,10 @@ func (a *Agent) mhandle(k string, h http.Handler) { setAgentLock.Unlock() } http.HandleFunc(k, func(w http.ResponseWriter, r *http.Request) { + vlog.Infof("mport request: %s, address: %s", r.URL.Path, r.RemoteAddr) if !PermissionCheck(r) { w.Write([]byte("need permission!")) + vlog.Warningf("mport request no permission: %s, address: %s", r.URL.Path, r.RemoteAddr) return } defer func() { diff --git a/core/motan.go b/core/motan.go index 03e764d8..22936c9c 100644 --- a/core/motan.go +++ b/core/motan.go @@ -1262,7 +1262,7 @@ func GetRuntimeInfo(s interface{}) map[string]interface{} { return map[string]interface{}{} } -//-----------CircularRecorder------------- +// -----------CircularRecorder------------- type circularRecorderItem struct { timestamp int64 value interface{}