Enhance logging across client, server, and ARQ layers#61
Open
mmdrn wants to merge 1 commit intomasterking32:mainfrom
Open
Enhance logging across client, server, and ARQ layers#61mmdrn wants to merge 1 commit intomasterking32:mainfrom
mmdrn wants to merge 1 commit intomasterking32:mainfrom
Conversation
Author
|
@masterking32 Please review this PR. |
Add SubLogger with context fields (session/stream IDs), session and stream lifecycle logs, silent error elimination, periodic stats reporting, and ARQ retransmit/timeout logging.
Author
|
@masterking32 Conflicts resolved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive, structured logging throughout the VPN system to improve operational observability and debugging.
Logger Enhancement
SubLoggertype withWith(key, value)chaining for automatic context propagation (e.g.,[Sess:3] [Str:42])Warnfto the ARQLoggerinterfaceSession Lifecycle Logging
Stream Lifecycle Logging
Silent Error Elimination
dns_listener.go(WARN)buildNoDataResponseLoggednow actually logs the reason (DEBUG)Periodic Stats Reporting
Balancer.Stats()method for aggregate connection statisticsARQ Logging
Design Decisions
SubLoggersatisfies the ARQLoggerinterface for seamless integrationFiles Changed (16)
internal/logger/logger.go— SubLogger typeinternal/logger/logger_test.go— 4 new testsinternal/arq/arq.go— Warnf interface + 5 log pointsinternal/arq/arq_test.go— testLogger updatedinternal/client/session.go— session lifecycle logsinternal/client/stream_client.go— stream lifecycle logsinternal/client/socks_manager.go— SOCKS result logsinternal/client/async_runtime.go— periodic stats loggerinternal/client/balancer.go— Stats() methodinternal/client/dispatcher.go— error path logsinternal/client/dns_listener.go— write error loginternal/client/tcp_listener.go— unsupported protocol loginternal/udpserver/server.go— server stats loggerinternal/udpserver/server_session.go— close rejection loginternal/udpserver/server_utils.go— NoData reason loginternal/udpserver/stream_server.go— stream creation logTesting
go build ./...clean