Struts2 + Log4j2

Struts2 + Log4j2

我正在开发 Struts2 网络应用程序并设置了记录器。官方文档中只有log4j的配置,没有关于log4j2的配置。我开始环顾四周,似乎 Struts2 不支持 log4j2。但我发现的最后一个问题是这个:

Log4j2.0 is not working with Jboss 5

Struts2 doesn't support Log4j 2.0 right now, there are plans to add support for it during upcoming strutsathon.opensource.io

自2013年回答此问题后,Struts2仍不支持Log4j2

你很幸运!在最新版本(2.3.24)中,如您在Releas Notes中所见,已添加:

New feature

  • [WW-4492]- Add support for Log4J2 as a struts and xwork logging backend