I'm setting up a project that uses ktor client to ...
# ktor
r
I'm setting up a project that uses ktor client to send both HTTP requests and outbound UDP requests. I've easily followed the docs to integrate my custom logger with the HTTP client, but I can't find anywhere specifying how to set up logs for the UDP side of things. The system also still prints the warning about not finding a SLF4J implementation and that it's falling back to no-op logging. So for an outbound UDP client, how can I either silence the SLF4J/no-op warning, or actually integrate a custom logger?
a
Which Ktor dependencies do you use for the UDP client?
r
Copy code
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-serialization-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
ktor-network = { module = "io.ktor:ktor-network", version.ref = "ktor" }
With
ktor = "3.0.3"
Screenshot_20250307-092942.png
The only docs I could find for UDP are here, and they say nothing of logging. I also could not find anything in the functions/classes themselves when inspecting source code via IDE
a
The
ktor-network
module doesn't use the SLF4J logger. Can you please try to leave only the relevant dependencies to check if the warning still occurs?