[PR #3585] [CLOSED] [client] Add gRPC logging interceptor for request and response tracking #23106

Open
opened 2026-08-05 06:06:48 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3585
Author: @hakansa
Created: 3/27/2025
Status: Closed

Base: mainHead: ref/logrus-factory


📝 Commits (9)

  • 2b92e51 client: add gRPC logging interceptor for request and response tracking
  • f8f5588 client: implement logrus-based logging factory and logger for ICE
  • 8ba08cf client: enhance gRPC logging with conditional output and improved error handling
  • 719fdbf client: update gRPC logging to ignore stdout and stderr outputs
  • ac46241 client: configure gRPC logger to use standard logger output based on log path
  • 274f50e client: remove gRPC logger implementation and related interceptor references
  • 2324196 client: simplify gRPC logger initialization by removing console output handling
  • 5732ee1 use logrus writer
  • d779391 remove ice log factory

📊 Changes

5 files changed (+18 additions, -21 deletions)

View changed files

📝 client/iface/bind/udp_mux.go (+5 -11)
📝 client/iface/bind/udp_mux_universal.go (+0 -8)
📝 client/iface/bind/udp_muxed_conn.go (+0 -2)
📝 client/internal/peer/ice/agent.go (+8 -0)
📝 util/log.go (+5 -0)

📄 Description

Describe your changes

adds logging interceptor to gRPC requests.

(keys redacted in the logs below)

2025-03-27T18:52:01+08:00 DEBUG client/grpc/logger/logger.go:28: gRPC request initiated: method=/management.ManagementService/GetServerKey, request={}
2025-03-27T18:52:01+08:00 DEBUG client/grpc/logger/logger.go:46: gRPC request succeeded: method=/management.ManagementService/GetServerKey, duration=205.779ms, response={"key":"BqHpsTib...","expiresAt":"1970-01-01T00:00:01.756579888Z"}
2025-03-27T18:52:01+08:00 DEBUG client/grpc/logger/logger.go:28: gRPC request initiated: method=/management.ManagementService/Login, request={"wgPubKey":"cAAioT+....","body":"fW+PnoG...."}
2025-03-27T18:52:02+08:00 DEBUG client/grpc/logger/logger.go:46: gRPC request succeeded: method=/management.ManagementService/Login, duration=323.006334ms, response={"wgPubKey":"BqHpsTib..."}

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/3585 **Author:** [@hakansa](https://github.com/hakansa) **Created:** 3/27/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `ref/logrus-factory` --- ### 📝 Commits (9) - [`2b92e51`](https://github.com/netbirdio/netbird/commit/2b92e514641d67fae17fa2c11243c2c612bdaa55) client: add gRPC logging interceptor for request and response tracking - [`f8f5588`](https://github.com/netbirdio/netbird/commit/f8f5588b943210c955e1a2903bfb5dd19ccca2dc) client: implement logrus-based logging factory and logger for ICE - [`8ba08cf`](https://github.com/netbirdio/netbird/commit/8ba08cfaa38490559df468f120b26fd8f2ec7646) client: enhance gRPC logging with conditional output and improved error handling - [`719fdbf`](https://github.com/netbirdio/netbird/commit/719fdbfe2debabb1fcfb4b7e6656946fedcb6647) client: update gRPC logging to ignore stdout and stderr outputs - [`ac46241`](https://github.com/netbirdio/netbird/commit/ac462415b228ecd8f54b61227371607bc3442b77) client: configure gRPC logger to use standard logger output based on log path - [`274f50e`](https://github.com/netbirdio/netbird/commit/274f50e63e85498c9a2418fff72c8132132bcddb) client: remove gRPC logger implementation and related interceptor references - [`2324196`](https://github.com/netbirdio/netbird/commit/2324196eed6993c563bb242f116a1460a2ececee) client: simplify gRPC logger initialization by removing console output handling - [`5732ee1`](https://github.com/netbirdio/netbird/commit/5732ee15ee542fc1076b5ba15e2696e24de1c9f5) use logrus writer - [`d779391`](https://github.com/netbirdio/netbird/commit/d7793914af9db58a4983949be85f263635b504d6) remove ice log factory ### 📊 Changes **5 files changed** (+18 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `client/iface/bind/udp_mux.go` (+5 -11) 📝 `client/iface/bind/udp_mux_universal.go` (+0 -8) 📝 `client/iface/bind/udp_muxed_conn.go` (+0 -2) 📝 `client/internal/peer/ice/agent.go` (+8 -0) 📝 `util/log.go` (+5 -0) </details> ### 📄 Description ## Describe your changes adds logging interceptor to gRPC requests. (keys redacted in the logs below) ``` 2025-03-27T18:52:01+08:00 DEBUG client/grpc/logger/logger.go:28: gRPC request initiated: method=/management.ManagementService/GetServerKey, request={} 2025-03-27T18:52:01+08:00 DEBUG client/grpc/logger/logger.go:46: gRPC request succeeded: method=/management.ManagementService/GetServerKey, duration=205.779ms, response={"key":"BqHpsTib...","expiresAt":"1970-01-01T00:00:01.756579888Z"} 2025-03-27T18:52:01+08:00 DEBUG client/grpc/logger/logger.go:28: gRPC request initiated: method=/management.ManagementService/Login, request={"wgPubKey":"cAAioT+....","body":"fW+PnoG...."} 2025-03-27T18:52:02+08:00 DEBUG client/grpc/logger/logger.go:46: gRPC request succeeded: method=/management.ManagementService/Login, duration=323.006334ms, response={"wgPubKey":"BqHpsTib..."} ``` ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 06:06:48 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#23106