You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit implements comprehensive logging improvements to ensure coherent
and consistent HTTP request/response logging throughout the Keylime system.
Changes made:
1. Centralized HTTP Logging in ResilientClient:
- Added consistent response code and header logging at DEBUG level
- All HTTP requests now have uniform logging behavior across the codebase
- Request headers already logged, now response headers match the same format
2. Fixed JSON Logging Issues:
- Request JSON now logged as proper JSON string instead of Rust debug format
- Changed from `{:?}` format to `serde_json::to_string()` for clean output
- All JSON logging moved from INFO to DEBUG level for consistency
- Added proper error handling for JSON serialization failures
3. Eliminated Duplicate Response Logging:
- Removed redundant response body logging in state_machine.rs
- Response information now logged exactly once per HTTP request
- Maintained necessary response data for application logic
4. Enhanced URL Logging Context:
- Added HTTP methods to URL logging (POST/PATCH)
- Improved chronological order: Phase 1 logs negotiation URL, Phase 2 logs evidence URL
- Made location header source explicit ("from 201 Created response")
- Consistent format: "Purpose URL (METHOD): {url}"
5. Protocol Flow Clarity:
- Capabilities negotiation URL logged in Phase 1 where it's used
- Evidence handling URL logged in Phase 2 where it's used
- Clear separation between configuration URLs and runtime URLs
The logging system now provides:
- Consistent DEBUG-level JSON and header logging
- No duplication of response information
- Clear chronological flow for the two-phase attestation protocol
- Centralized HTTP logging behavior via ResilientClient middleware
Co-Authored-By: Claude <[email protected]>
Signed-off-by: Sergio Arroutbi <[email protected]>
0 commit comments