[jboss-jira] [JBoss JIRA] (LOGMGR-89) LogContext's root logger is not created with a strong child hash map when strong=true

RH Bugzilla Integration (JIRA) jira-events at lists.jboss.org
Fri Nov 15 17:59:06 EST 2013


    [ https://issues.jboss.org/browse/LOGMGR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924204#comment-12924204 ] 

RH Bugzilla Integration commented on LOGMGR-89:
-----------------------------------------------

Kyle Lape <klape at redhat.com> made a comment on [bug 1031221|https://bugzilla.redhat.com/show_bug.cgi?id=1031221]

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].
                
> LogContext's root logger is not created with a strong child hash map when strong=true
> -------------------------------------------------------------------------------------
>
>                 Key: LOGMGR-89
>                 URL: https://issues.jboss.org/browse/LOGMGR-89
>             Project: JBoss Log Manager
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>         Environment: This issue happens on 32-bit JVMs, and I can reproduce it on JDK 6 (64-bit)
>            Reporter: Kyle Lape
>            Assignee: David Lloyd
>
> 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
> {code:xml}
> <?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>
> {code}
> Every log message ends up in {{SAMPLE_APP}}, regardless of which logger was used.  One message like this is also printed to the log:
> {noformat}
> 11:33:00,110 INFO  [stdout] (Finalizer) log4j: Finalizing appender named [SAMPLE_APP_MDB].
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list