From 5c41d343ca1d9c6c2f2b436b920fced607dc85f9 Mon Sep 17 00:00:00 2001 From: tbjump Date: Sat, 14 Jan 2023 19:39:58 +0000 Subject: [PATCH] node: add logging for public rpc requests --- node/cmd/guardiand/publicweb.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/node/cmd/guardiand/publicweb.go b/node/cmd/guardiand/publicweb.go index 3537332b0..1e3b6c750 100644 --- a/node/cmd/guardiand/publicweb.go +++ b/node/cmd/guardiand/publicweb.go @@ -75,6 +75,13 @@ func publicwebServiceRunnable( mux := http.NewServeMux() grpcWebServer := grpcweb.WrapServer(grpcServer) mux.Handle("/", allowCORSWrapper(http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) { + + logger.Info("public rpc request", + zap.String("method", req.Method), + zap.String("path", req.URL.Path), + zap.String("remote_addr", req.RemoteAddr), + zap.Any("headers", req.Header)) + if grpcWebServer.IsGrpcWebRequest(req) { grpcWebServer.ServeHTTP(resp, req) } else {