Nested log4j handler missing in WildFly 26

51 views
Skip to first unread message

Tom Eugelink

unread,
Jun 5, 2023, 10:57:31 AM6/5/23
to WildFly
We're in the process of upgrading from JBoss 7 to WildFly 26, and we're almost done. There is one thing that is confusing, in the log4j.xml there is this sniplet:

<logger name="RequestLogFilter">
<appender-ref ref="RequestLog"/>
</logger>

This adds a specific appender to a logger. In JBoss 7 this results in an org.jboss.logmanager.LoggerNode instance with the name "RequestLogFilter", where its handlers collection contains the "RequestLog" appender. 

Under WildFly 26 the exact same log4j.xml file, with that (valid) configuration, also results in a LoggerNode, but its handler collection is empty. And thus the logging does not happen.

Does anyone have any insight why this configuration is not behaving the same? Or where I can find the code where this configuration is read? This is not standard log4j, so -Dlog4j.debug does not really help.

Thanks! 

Tom

James Perkins

unread,
Jun 5, 2023, 11:01:00 AM6/5/23
to WildFly
Where is the log4j.xml located? It should still work in WildFly 26 as log4j 1.x is still supported. It will no longer work in WildFly 27+ as log4j 1.x support has been removed.

Tom Eugelink

unread,
Jun 5, 2023, 12:32:59 PM6/5/23
to WildFly
It turns out the logging configuration is also present (and was missing) in the standalone.xml. I'm pretty confused now how log4j.xml and standalone.xml interact. Put an issue on my name to figure that out and clean stuff up. But the problem was that I was barking up the wrong tree.

James Perkins

unread,
Jun 5, 2023, 12:36:19 PM6/5/23
to WildFly
If your deployment includes a log4j.xml then the log4j log manager will be configured to use that configuration. Any logging that happens with a log4j logger in your deployment will use that configuration. The logging subsystem is used for all other logging. This includes all server modules and any loggers in your deployment which do no use log4j.

In WildFly 27, log4j was removed due to it being EOL since 2015.

Bartosz Baranowski

unread,
Jun 6, 2023, 1:46:02 AM6/6/23
to WildFly
Reply all
Reply to author
Forward
0 new messages