node: add logging for public rpc requests

This commit is contained in:
tbjump 2023-01-14 19:39:58 +00:00 committed by Evan Gray
parent 3f61661051
commit 5c41d343ca
1 changed files with 7 additions and 0 deletions

View File

@ -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 {