Open cbxp opened 3 days ago
I want to use custom logger.
I created class CustomLogger:
CustomLogger
class CustomLogger(name: String) : KliteLogger(name) { ... }
I added this class to file ".env":
LOGGER_CLASS=com.app.CustomLogger
Class CustomLogger is used for logging
The default class KliteLogger is used instead of CustomLogger.
KliteLogger
The reason is that this line is executed BEFORE reading ".env" file:
class KliteLoggerFactory: ILoggerFactory { private val loggers = ConcurrentHashMap<String, Logger>() private val loggerConstructor = findConstructor(Config.optional("LOGGER_CLASS", KliteLogger::class.java.name))
I want to use custom logger.
I created class
CustomLogger
:I added this class to file ".env":
Expected result:
Class
CustomLogger
is used for loggingActual result:
The default class
KliteLogger
is used instead ofCustomLogger
.Hint
The reason is that this line is executed BEFORE reading ".env" file: