[log] Add debug logging to server HTTP server scaffold#5388
Merged
Conversation
Add logHTTPServer debug logger to the HTTP server scaffold functions to improve troubleshooting of server startup and configuration issues. Logs include: - HTTP server creation with address - MCP HTTP server build parameters (address, auth/HMAC enabled flags) - Session timeout configuration - Server scaffold completion status Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated debug logger for the HTTP server scaffold in internal/server/http_server.go, improving startup-time observability of server creation and key configuration (bind address, auth/HMAC enablement, and resolved session timeout) when DEBUG patterns enable server logs.
Changes:
- Introduces a
server:http_serverdebug logger (logHTTPServer) in the HTTP server scaffold file. - Adds debug logs in
newHTTPServerandbuildMCPHTTPServerto trace server creation and configuration inputs. - Logs the resolved session timeout and a “ready” marker once the scaffold is built.
Show a summary per file
| File | Description |
|---|---|
| internal/server/http_server.go | Adds server:http_server debug logger and startup scaffold logging for HTTP server construction and session timeout resolution. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
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
Adds
logHTTPServerdebug logger tointernal/server/http_server.goto improve visibility into HTTP server creation and configuration during startup.Changes
Added 4 meaningful debug log calls:
newHTTPServer: logs the address when creating the HTTP serverbuildMCPHTTPServer: logs build parameters (address, auth/HMAC enabled state), resolved session timeout, and completion statusWhy This Helps
The
buildMCPHTTPServerfunction is the central scaffold used by both routed and unified modes. WithDEBUG=server:*, operators can now trace:Validation
go test ./internal/...passes (exit 0)pkg:filenamenaming convention:"server:http_server"