WiretapConfig¶
WiretapConfig is the shared configuration class used by both Ktor and OkHttp plugins.
Properties¶
enabled¶
Type: Boolean — Default: true
Master switch. When false, the plugin passes requests through without any logging, rule evaluation, or overhead.
shouldLog¶
Type: (url: String, method: String) -> Boolean — Default: { _, _ -> true }
Filter which requests are captured in the log database. Evaluated before any DB write.
Note
Requests that don't pass shouldLog are still subject to mock/throttle rules — they just won't appear in the inspector.
headerAction¶
Type: (key: String) -> HeaderAction — Default: { HeaderAction.Keep }
Controls how each header is treated in logged data. Called for every header key in both requests and responses. See Header Actions for details.
headerAction = { key ->
when {
key.equals("Authorization", ignoreCase = true) -> HeaderAction.Mask()
key.equals("Cookie", ignoreCase = true) -> HeaderAction.Skip
else -> HeaderAction.Keep
}
}
logRetention¶
Type: LogRetention — Default: LogRetention.Forever
Controls how long log entries are retained. See Log Retention for details.
maxContentLength¶
Type: Int — Default: 512000 (500 KB)
Maximum number of characters to store for request and response bodies. Bodies exceeding this limit are truncated before being saved to the database. Capped at 500 * 1024 (500 KB). Set to 0 to skip body logging entirely.