更新时间:2023-01-10 16:28:47
Log4j不允许在多个文件之间拆分日志.基本思想是所有日志语句都被认为是相等的,应该被平等对待.
Log4j does not easily allow for splitting logs between multiple files. The basic idea is that all log statements are considered equal and should be treated equally.
如果您使用slf4j作为API,则可以轻松地将后端从log4j切换到具有SiftingAppender的logback来实现此目的.
If you were using slf4j as the API you could easily switch the backend from log4j to logback which has SiftingAppender for exactly this purpose.