When deploying an application in EAP 6 that has a log4j.xml that is deployed by the logging subsystem, it seems that the LogContext is somehow losing a reference to a custom logger, causing all configuration for that logger to be lost. Given this configuration: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <appender name="SAMPLE_APP" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="${jboss.server.log.dir}/SampleApp.log"/> <param name="MaxFileSize" value="2MB"/> <param name="MaxBackupIndex" value="5"/> <param name="Append" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %c [%t] %-5p - %m%n"/> </layout> </appender> <appender name="SAMPLE_APP_MDB" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="${jboss.server.log.dir}/SampleApp-MDB.log"/> <param name="MaxFileSize" value="2MB"/> <param name="MaxBackupIndex" value="5"/> <param name="Append" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %c [%t] %-5p - %m%n"/> </layout> </appender> <logger name="com.redhat" additivity="false"> <level value="TRACE"/> <appender-ref ref="SAMPLE_APP_MDB"/> </logger> <root> <priority value="TRACE"/> <appender-ref ref="SAMPLE_APP"/> </root> </log4j:configuration> Every log message ends up in {{SAMPLE_APP}}, regardless of which logger was used. One finalizer message is also printed to the log: 11:33:00,110 INFO [stdout] (Finalizer) log4j: Finalizing appender named [SAMPLE_APP_MDB].
James Perkins <jperkins> updated the status of jira LOGMGR-89 to Resolved
Setting flag for inclusion in 6.2.1 release notes.
Set 'Version' field to ensure this ticket appears in documentation effort dashboards.
Hi James. Can you provide a few details in the Doc Text box above. I took a shot at the 'Consequence' and 'Result' fields, as best I could with what I can grok. Could you fill in the gaps and straighten out my attempts if I've misunderstood? Thanks in advance.
I updated it the best I could think of. Just as a general note, if it matters, this only affected log4j.
Thanks James. Very much appreciated. Editing doc text for publication and marking for inclusion in document.
Verified on EAP 6.2.1 CP CR3