Skip to content

Log HTTP access and JSON-RPC error responses - #350

Open
venti1112 wants to merge 1 commit into
leehack:mainfrom
venti1112:main
Open

Log HTTP access and JSON-RPC error responses#350
venti1112 wants to merge 1 commit into
leehack:mainfrom
venti1112:main

Conversation

@venti1112

Copy link
Copy Markdown

Add structured access logging and error-response logging. _handleRequest now captures the remote address, calls a new _handleRequestCore, 和 logs method, path, status, reason, MCP session id, and remote IP in a finally block (guarded to never break request handling). Also log JSON-RPC error responses at warn level with HTTP status, MCP error code, optional request id, and message. These changes improve observability while preserving request flow and safety.

Add structured access logging and error-response logging. _handleRequest now captures the remote address, calls a new _handleRequestCore, and logs method, path, status, reason, MCP session id, and remote IP in a finally block (guarded to never break request handling). Also log JSON-RPC error responses at warn level with HTTP status, MCP error code, optional request id, and message. These changes improve observability while preserving request flow and safety.
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.87%. Comparing base (a0f3f7f) to head (8720b15).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #350   +/-   ##
=======================================
  Coverage   85.86%   85.87%           
=======================================
  Files          82       82           
  Lines       20514    20529   +15     
=======================================
+ Hits        17615    17629   +14     
- Misses       2899     2900    +1     
Flag Coverage Δ
cli 78.11% <ø> (ø)
unittests 88.30% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant