Does anyone know why I'm getting this error messag...
# server
a
Does anyone know why I'm getting this error message? it shows right after commenting on the implementation
ch.qos.logback:logback-classic
I'm using Kotlin JVM but I want to not use the logback classic and use the Kotlin/native simple logger
stackoverflow 2
r
Did you visit the "See xxx for further details." link in the error? It works, and explains what you need to do... Something is bringing in SLF4J transitively, and trying to log to it. SLF4J is just a facade, If something tries to log to it and no implementation is present it spits that error out to standard err. I don't know what you mean by "Kotlin/native simple logger".
a
I don't know what you mean by "Kotlin/native simple logger". Perhaps
https://ktor.io/docs/logging.html#native
Remove the word simple, there is another built-in logger that doesn't require anything related to jvm
Doesn't require the library I mentioned above or the logbacl.xml
The docs doesn't cover on how to not use the default logger
r
Are you sure you're running the native server? That run dialogue looks like you are running a JVM.
a
Of kotlin/nvm
No, I'm running Kotlin/JVM and I just want to disable the default logger to use the Kotlin/Native, it ƒunction is already avaliable on Kotlin/JVM, just need to disable the logger or Kotlin/JVM
r
> Ktor provides different means of logging your application depending on the used platform: > > On JVM, Ktor uses SLF4J API as a facade for various logging frameworks (for example, Logback or Log4j) and allows you to log application events. To enable logging, you need to add dependencies for the desired framework and provide configuration specific for this framework. > > You can also install and configure the CallLogging plugin to log client requests. > > For the Native server, Ktor provides a logger that prints everything to the standard output. https://ktor.io/docs/logging.html
a
That's the same link I sent
r
Why do you think it is incorrect when it says "On JVM, Ktor uses SLF4J API"
a
And I want to disable it
I'm just asking if there is a way to
r
If you don't want any logs at all, add
implementation("org.slf4j:slf4j-nop:1.7.36")
to your dependencies.
If you want logging to std err without configuration (or std out if you set a system property
org.slf4j.simpleLogger.logFile=System.out
), add
implementation("org.slf4j:slf4j-simple:1.7.36")
.
👍 1
a
ok, thanks
a
its ironic that disabling (removing) a feature requires adding a dependency
👍 1
r
Rather than disabling a feature think of it as replacing the implementation of an interface the code depends on.