Class HttpRequestLog
java.lang.Object
io.leandev.appfuse.http.logging.HttpRequestLog
HTTP 請求日誌模型
記錄 HTTP 請求的完整資訊,用於除錯追蹤與安全稽核。
設計理念
- 結構化日誌:所有欄位都有明確的類型與意義
- 隱私保護:敏感資訊已透過
SensitiveDataMasker遮罩 - 輕量級:使用 Lombok 減少樣板程式碼
- 不可變:使用 @Builder 確保執行緒安全
使用範例
HttpRequestLog log = HttpRequestLog.builder()
.timestamp(Instant.now())
.method("POST")
.url("https://api.example.com/users")
.headers(headers)
.body("{\"username\":\"admin\"}")
.authenticated(true)
.viaGateway(false)
.build();
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
HttpRequestLog
public HttpRequestLog()
-