View | Details | Raw Unified | Return to bug 38982
Collapse All | Expand All

(-)../log4j/src/java/org/apache/log4j/AsyncAppender.java (-10 / +11 lines)
Lines 46-52 Link Here
46
 * </p>
46
 * </p>
47
 * <p/>
47
 * <p/>
48
 * <b>Important note:</b> The <code>AsyncAppender</code> can only be script
48
 * <b>Important note:</b> The <code>AsyncAppender</code> can only be script
49
 * configured using the {@link org.apache.log4j.joran.JoranConfigurator}.
49
 * configured using the {@link org.apache.log4j.xml.DOMConfigurator}.
50
 * </p>
50
 * </p>
51
 *
51
 *
52
 * @author Ceki G&uuml;lc&uuml;
52
 * @author Ceki G&uuml;lc&uuml;
Lines 103-109 Link Here
103
   * Create new instance.
103
   * Create new instance.
104
   */
104
   */
105
  public AsyncAppender() {
105
  public AsyncAppender() {
106
    super(true);
107
    appenders = new AppenderAttachableImpl();
106
    appenders = new AppenderAttachableImpl();
108
107
109
    //
108
    //
Lines 150-159 Link Here
150
      return;
149
      return;
151
    }
150
    }
152
151
153
    // extract all the thread dependent information now as later it will
152
    // Set the NDC and thread name for the calling thread as these
154
    // be too late.
153
    // LoggingEvent fields were not set at event creation time.
155
    event.prepareForDeferredProcessing();
154
    event.getNDC();
156
155
    event.getThreadName();
156
    // Get a copy of this thread's MDC.
157
    event.getMDCCopy();
157
    if (locationInfo) {
158
    if (locationInfo) {
158
      event.getLocationInformation();
159
      event.getLocationInformation();
159
    }
160
    }
Lines 237-243 Link Here
237
      dispatcher.join();
238
      dispatcher.join();
238
    } catch (InterruptedException e) {
239
    } catch (InterruptedException e) {
239
      Thread.currentThread().interrupt();
240
      Thread.currentThread().interrupt();
240
      getLogger().error(
241
      org.apache.log4j.helpers.LogLog.error(
241
        "Got an InterruptedException while waiting for the "
242
        "Got an InterruptedException while waiting for the "
242
        + "dispatcher to finish.", e);
243
        + "dispatcher to finish.", e);
243
    }
244
    }
Lines 463-469 Link Here
463
          new Object[] { new Integer(count), maxEvent.getMessage() });
464
          new Object[] { new Integer(count), maxEvent.getMessage() });
464
465
465
      return new LoggingEvent(
466
      return new LoggingEvent(
466
        null, maxEvent.getLogger(), maxEvent.getLevel(), msg, null);
467
        null, Logger.getLogger(maxEvent.getLoggerName()), maxEvent.getLevel(), msg, null);
467
    }
468
    }
468
  }
469
  }
469
470
Lines 531-542 Link Here
531
          //
532
          //
532
          synchronized (buffer) {
533
          synchronized (buffer) {
533
            int bufferSize = buffer.size();
534
            int bufferSize = buffer.size();
534
            isActive = !parent.isClosed();
535
            isActive = !parent.closed;
535
536
536
            while ((bufferSize == 0) && isActive) {
537
            while ((bufferSize == 0) && isActive) {
537
              buffer.wait();
538
              buffer.wait();
538
              bufferSize = buffer.size();
539
              bufferSize = buffer.size();
539
              isActive = !parent.isClosed();
540
              isActive = !parent.closed;
540
            }
541
            }
541
542
542
            if (bufferSize > 0) {
543
            if (bufferSize > 0) {

Return to bug 38982