Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-188

The "appender-ref" functionality doesn't work perfectly in the AsynchAppender

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0-beta4
    • 2.0-beta5
    • Appenders
    • None

    Description

      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()));
      ...

      Attachments

        Activity

          People

            rgoers Ralph Goers
            gow Werner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: