TRACE StatusLogger Log4jLoggerFactory.getContext() 找到锚点类

ane*_*hev 5 java logging log4j slf4j log4j2

当我启动任何应用程序时,我会在控制台和日志中收到很多这样的行:

TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.auth.api.SessionAgentImpl
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.api.AbstractCloseableAgent
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.api.AbstractCentral
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.api.AbstractCloseHooksHandler
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.core.api.plugins.AbstractCorePlugin
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.config.api.ConfigImpl
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.api.AbstractCentral
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.api.AbstractCloseHooksHandler
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.api.AbstractCloseableAgent
TRACE StatusLogger Log4jLoggerFactory.getContext() found anchor class com.example.api.AbstractCentral
Run Code Online (Sandbox Code Playgroud)

然后这些行一次又一次出现在日志中。它是在将 log4j 版本更新到 2.15.0 及更高版本后开始的。

有遇到过吗?

Mic*_*sma 6

正如piotr-p-karwasz评论的,您很可能将系统属性设置为。删除系统属性或将其设置为禁用。这为我解决了这个问题。log4j2.debugtruelog4j2.debugfalse