静态Logger参考仍然能够记忆泄漏吗?

时间:2017-08-18 00:46:30

标签: java logging log4j2

我正在研究日志策略,我找到了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年写的。

0 个答案:

没有答案