Commit 5e32460
Improve logging consistency and coherency
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]>1 parent f310fac commit 5e32460
File tree
3 files changed
+18
-10
lines changed- keylime-push-model-agent/src
- keylime/src
3 files changed
+18
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| |||
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | | - | |
107 | | - | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
157 | | - | |
| 158 | + | |
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 198 | + | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
49 | 58 | | |
50 | 59 | | |
51 | 60 | | |
| |||
0 commit comments