Hi! How do I use a Ktor server with a custom loggi...
# ktor
v
Hi! How do I use a Ktor server with a custom logging framework, say
kotlin-logging
? Couldn't find it in the docs. The less xml the better. Thanks!
s
kotlin logger is just a convenient wrapper around slf4j. it is not a logging framework. just use logback with a little xml 😄
🙄 1
n
Logging is an area that needs improvement in Ktor. The official documentation should have sections for the other major Logging libraries/frameworks. Ktor shouldn't be mandating logback.
Currently slf4j v1 works with Ktor, however v2 doesn't (Ktor doesn't detect it).
v
I wish logging was configured in the code just like all the other ktor features and didn't rely on autodetection
âž• 1
💯 1
s
Out of curiosity, what’s wrong with logback?
n
Many people find it much easier to deal with Properties files (some libraries/frameworks use this like Spring Boot for example) for configuration, and Logback uses XML for configuration, which is difficult to deal with.
s
oh that’s it? Man, you’re spoiled 😄 Log4J can be slf4j backend as well. and it uses properties, but I found logback to be far more superior in terms performance, extensibility and configurability.
nm, just wanted to check if I am not missing something important