Network
Log requests and responses for APM and bug reports in your KMP app. Covers the Luciq Ktor plugin, W3C trace headers, and manual NetworkLogger calls.
Last updated
Log requests and responses for APM and bug reports in your KMP app. Covers the Luciq Ktor plugin, W3C trace headers, and manual NetworkLogger calls.
Network requests and responses can be logged for APM and bug reports. The KMP library provides:
Luciq Ktor plugin – Intercepts Ktor HttpClient calls, injects W3C trace headers, and logs requests/responses.
NetworkLogger – Manual logging and callbacks for obfuscation and omission.
Install the plugin on your HttpClient so all requests and responses are logged and W3C headers are injected:
import ai.luciq.kmp.interceptors.LuciqKtorPlugin
val client = HttpClient(engine) {
install(LuciqKtorPlugin)
}No extra code is needed for each request; the plugin handles timing, headers, and body capture (subject to size limits and obfuscation/omission callbacks).
If you are not using Ktor or need to log a request from another HTTP client, use NetworkLoggerKmp.networkLog with a NetworkData instance. Build NetworkData with your request/response details (URL, method, headers, body, timestamps, status, etc.). See the Network Logging (Ktor) section for obfuscation and omission.
NetworkLoggerKmp.setNetworkLogBodyEnabled(true)
NetworkLoggerKmp.setNetworkAutoMaskingEnabled(true)For full details and W3C header usage, see Network Logging (Ktor) and Obfuscation & Omission.
Last updated