我正在研究日志策略,我找到了this article,讨论了static
记录器引用的危险。
The official log4j2
documentation在其示例中显示了static
记录器模式,因此这让我对此非常感兴趣:
// Define a static logger variable so that it references the
// Logger instance named "MyApp".
private static final Logger logger = LogManager.getLogger(MyApp.class);
我正在使用log4j2
,我想知道这是否仍然是一个问题,因为这篇文章是在2009年写的。