Werner  created LOG4J2-188:
------------------------------

             Summary: The "appender-ref" functionality doesn't work perfectly 
in the AsynchAppender
                 Key: LOG4J2-188
                 URL: https://issues.apache.org/jira/browse/LOG4J2-188
             Project: Log4j 2
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 2.0-beta4
            Reporter: Werner 
            Priority: Minor


The full "appender-ref" function (level & filter) doesn't work at the 
AsynchAppender like in the Logger-Configuration.

                <Asynch name="AsynchTest" blocking="true" bufferSize="2" 
error-ref="xy" suppressExceptions="true">
                        <appender-ref ref="ListAppender" />                  
<== do the job
                        
                        <appender-ref ref="ErrorAppender" level="Error" />   
<== don't work
                        
                        <appender-ref ref="FilterAppender" level="Error">    
<== don't work
                                <MarkerFilter marker="TEST" onmatch="accept" 
onmismatch="deny" />    
                        </appender-ref>
                </Asynch>


proposal for solution:
AsynchAppender.java : line 79

    @Override
    public void start() {
        final Map<String, Appender> map = config.getAppenders();
        final List<AppenderControl> appenders = new 
ArrayList<AppenderControl>();
        for (final AppenderRef appenderRef : appenderRefs) {
            if (map.containsKey(appenderRef.getRef())) {
                 // appenders.add(new 
AppenderControl(map.get(appenderRef.getRef()), null, null));
                 // new =>                 
appenders.add(new AppenderControl(map.get(appenderRef.getRef()), 
appenderRef.getLevel(), appenderRef.getFilter()));    
         ...

--
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

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to