diff --git a/src/jvmMain/kotlin/io/github/oshai/kotlinlogging/internal/KLoggerFactory.kt b/src/jvmMain/kotlin/io/github/oshai/kotlinlogging/internal/KLoggerFactory.kt index a244290..ce582c5 100644 --- a/src/jvmMain/kotlin/io/github/oshai/kotlinlogging/internal/KLoggerFactory.kt +++ b/src/jvmMain/kotlin/io/github/oshai/kotlinlogging/internal/KLoggerFactory.kt @@ -13,7 +13,7 @@ internal actual object KLoggerFactory { if (System.getProperty("kotlin-logging-to-jul") != null) { return JulLoggerFactory.wrapJLogger(JulLoggerFactory.jLogger(name)) } else if (System.getProperty("kotlin-logging-to-logback") != null) { - return LogbackLoggerFactory.wrapJLogger(LogbackLoggerFactory.jLogger(name)) + return LogbackLoggerFactory.wrapLogbackLogger(LogbackLoggerFactory.logbackLogger(name)) } // default to slf4j return Slf4jLoggerFactory.wrapJLogger(Slf4jLoggerFactory.jLogger(name)) diff --git a/src/jvmMain/kotlin/io/github/oshai/kotlinlogging/logback/internal/LogbackLoggerFactory.kt b/src/jvmMain/kotlin/io/github/oshai/kotlinlogging/logback/internal/LogbackLoggerFactory.kt index 2537d40..114814f 100644 --- a/src/jvmMain/kotlin/io/github/oshai/kotlinlogging/logback/internal/LogbackLoggerFactory.kt +++ b/src/jvmMain/kotlin/io/github/oshai/kotlinlogging/logback/internal/LogbackLoggerFactory.kt @@ -15,13 +15,12 @@ internal object LogbackLoggerFactory { return logbackServiceProvider } - /** get a java logger by name. Logback relies on SLF4J logger factory */ - internal fun jLogger(name: String): Logger = + /** Get a Logback logger by name. Logback relies on SLF4J logger factory */ + internal fun logbackLogger(name: String): Logger = logbackServiceProvider.loggerFactory.getLogger(name) as Logger - /** wrap java logger based on location awareness */ - internal fun wrapJLogger(jLogger: Logger): KLogger = - LogbackLoggerWrapper(jLogger, logbackServiceProvider) + internal fun wrapLogbackLogger(logbackLogger: Logger): KLogger = + LogbackLoggerWrapper(logbackLogger, logbackServiceProvider) fun getLoggerContext() = logbackServiceProvider.loggerFactory as LoggerContext }