Hi everyone, I’m facing error while calling Ktor A...
# ktor
a
Hi everyone, I’m facing error while calling Ktor API
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
This error doesn’t come when i pass HashMap<String, String> to body But whenever i’m passing,
HashMap<String, Any>
then only getting error. Any idea? Do I need to add SLF4J dependency🤔
a
That error usually gets printed if you haven't added the slf4j dependency.
It has nothing to do with your HashMap
Also, it is just a warning. If you don't need such logging you can ignore it
a
No It’s just not a warning. I think API was not called due to this error.
a
You say the error doesn't come when you pass a HasMap<String,String>, right. Pass that and loom at your console
a
HashMap<String,String> is working fine for many APIs Actually hashMap for some request had nested map also So I needed HashMap<String, Any> Anyhow , I replaced HashMap with one model class And passing that class into request body So working fine for now.
r
This log is printed by slf4j when there is no logging dependency found. It’s not related to you API. Add one of the required dependencies, for example
ch.qos.logback:logback-classic:1.2.3
and you will see real error logs.
👍 2
585 Views