Logging

note

Logging - 图1

This help topic is in development and will be updated in the future.

This feature adds multiplatform logging for HTTP calls.

Installation

  1. val client = HttpClient() {
  2. install(Logging) {
  3. logger = Logger.DEFAULT
  4. level = LogLevel.HEADERS
  5. }
  6. }

note

Logging - 图2

To use this feature, you need to include io.ktor:ktor-client-logging-jvm artifact on the JVM and ktor-client-logging-native on iOS.