Can't choose Kotlin-Logging logger name

Viewed 26

Kotlin-logging is a thin convenience wrapper around SLF4J. Its docs indicate I can choose an arbitrary logger name. But when I do, the logger stops working :-(

Here are the log declaration and log format that do work.

logback.xml file: <pattern>%d{HH:mm} %-5level %logger - %msg%n</pattern>

Kotlin file: val log = KotlinLogging.logger {}

Here are ways I specified logger name, which made logging in the class file stop working.

val log = KotlinLogging.logger("FOO")
val log = KotlinLogging.logger("FOO")
val log = LoggerFactory.getLogger("FOO")
val log = LoggerFactory.getLogger("FOO").toKLogger()

NOTES:

  • There are no messages to stderr indicating a log format or log setup errors.
  • Other logging in the app continues to work fine.
  • I only do console logging.
  • This is only for a personal project.

Question: Does kotlin-logging allow specifying an arbitrary logger name? If yes, how?

Thanks for your help.

0 Answers
Related