Logging

Estimated reading time: 1 minute

This feature add multiplatform logging for http calls.

This feature is defined in the class io.ktor.client.features.logging.Logging in the artifact io.ktor:ktor-client-logging:$ktor_version.
dependencies { compile "io.ktor:ktor-client-logging:$ktor_version" }
dependencies { compile("io.ktor:ktor-client-logging:$ktor_version") }
<project> ... <dependencies> <dependency> <groupId>io.ktor</groupId> <artifactId>ktor-client-logging</artifactId> <version>${ktor.version}</version> <scope>compile</scope> </dependency> </dependencies> </project>

Installation

val client = HttpClient() {
    install(Logging) {
        logger = Logger.DEFAULT
        level = LogLevel.HEADERS
    }
}