我尝试仅将特定日志记录到各自的文件中,但未能做到这一点,我尝试了在堆栈溢出时共享的多个选项,但它们都不起作用。主要是此链接但不起作用Logging individual level
以下是我想做的例子
logger.error("logging error text") -> Should go only into log-error file
logger.warn("logging warn text") -> Should go only into log-warn file
logger.info("logging info text") -> Should go only into log-info file
logger.debug("logging debug text") -> Should go only into log-debug file
现在正在发生的事情
logger.error("logging error text") -> Going into multiple file-> log-error file, log-warn file,
log-info file, log-debug file
logger.warn("logging warn text") -> Going into multiple file-> log-warn file,log-debug file, log-
debug file
logger.info("logging info text") -> Going into multiple file-> log-info file , log-debug file
logger.debug("logging debug text") -> Going into multiple file-> log-debug file