[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.25-52-g8f3f521

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Wed Dec 22 18:13:07 CET 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  8f3f52105b1f95909cb48be721fe3046473b2a4b (commit)
      from  20c3ef5ec9336719396f67866630e3a5807afa34 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=8f3f52105b1f95909cb48be721fe3046473b2a4b
http://github.com/ceki/logback/commit/8f3f52105b1f95909cb48be721fe3046473b2a4b

commit 8f3f52105b1f95909cb48be721fe3046473b2a4b
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Wed Dec 22 18:12:51 2010 +0100

    - Improved testing of CyclicBufferTracker. Added support for immediate
    removal of buffer if requested by the user.

diff --git a/logback-access/src/main/java/ch/qos/logback/access/net/SMTPAppender.java b/logback-access/src/main/java/ch/qos/logback/access/net/SMTPAppender.java
index 4584e4f..7b1d60c 100644
--- a/logback-access/src/main/java/ch/qos/logback/access/net/SMTPAppender.java
+++ b/logback-access/src/main/java/ch/qos/logback/access/net/SMTPAppender.java
@@ -63,7 +63,7 @@ public class SMTPAppender extends SMTPAppenderBase<AccessEvent> {
   protected void fillBuffer(CyclicBuffer<AccessEvent> cb, StringBuffer sbuf) {
     int len = cb.length();
     for (int i = 0; i < len; i++) {
-      // sbuf.append(MimeUtility.encodeText(layout.format(cb.get())));
+      // sbuf.append(MimeUtility.encodeText(layout.format(cb.getOrCreate())));
       AccessEvent event = (AccessEvent) cb.get();
       sbuf.append(layout.doLayout(event));
     }
@@ -86,5 +86,8 @@ public class SMTPAppender extends SMTPAppenderBase<AccessEvent> {
     return pl;
   }
 
+  protected boolean isEventMarkedForBufferRemoval(AccessEvent eventObject) {
+    return false;
+  }
 
 }
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/ClassicConstants.java b/logback-classic/src/main/java/ch/qos/logback/classic/ClassicConstants.java
index 193a31d..2972d2d 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/ClassicConstants.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/ClassicConstants.java
@@ -13,6 +13,9 @@
  */
 package ch.qos.logback.classic;
 
+import org.slf4j.Marker;
+import org.slf4j.MarkerFactory;
+
 public class ClassicConstants {
   static public final String USER_MDC_KEY = "user";
 
@@ -41,4 +44,6 @@ public class ClassicConstants {
   public final static String REQUEST_X_FORWARDED_FOR = "req.xForwardedFor";
 
   public final static String GAFFER_CONFIGURATOR_FQCN = "ch.qos.logback.classic.gaffer.GafferConfigurator";
+
+  public final static Marker FINALIZE_SESSION_MARKER = MarkerFactory.getMarker("FINALIZE_SESSION");
 }
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/net/SMTPAppender.java b/logback-classic/src/main/java/ch/qos/logback/classic/net/SMTPAppender.java
index 262bd91..faa1580 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/net/SMTPAppender.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/net/SMTPAppender.java
@@ -13,6 +13,7 @@
  */
 package ch.qos.logback.classic.net;
 
+import ch.qos.logback.classic.ClassicConstants;
 import ch.qos.logback.classic.PatternLayout;
 import ch.qos.logback.classic.boolex.OnErrorEvaluator;
 import ch.qos.logback.classic.spi.ILoggingEvent;
@@ -20,6 +21,7 @@ import ch.qos.logback.core.Layout;
 import ch.qos.logback.core.boolex.EventEvaluator;
 import ch.qos.logback.core.helpers.CyclicBuffer;
 import ch.qos.logback.core.net.SMTPAppenderBase;
+import org.slf4j.Marker;
 
 /**
  * Send an e-mail when a specific logging event occurs, typically on errors or
@@ -86,6 +88,15 @@ public class SMTPAppender extends SMTPAppenderBase<ILoggingEvent> {
     }
   }
 
+  protected boolean isEventMarkedForBufferRemoval(ILoggingEvent eventObject) {
+    Marker marker = eventObject.getMarker();
+    if(marker == null)
+      return false;
+
+    return marker.contains(ClassicConstants.FINALIZE_SESSION_MARKER);
+  }
+
+
   @Override
   protected Layout<ILoggingEvent> makeSubjectLayout(String subjectStr) {
     if(subjectStr == null) {
@@ -102,6 +113,7 @@ public class SMTPAppender extends SMTPAppenderBase<ILoggingEvent> {
     return pl;
   }
 
+
   protected PatternLayout makeNewToPatternLayout(String toPattern) {
     PatternLayout pl = new PatternLayout();
     pl.setPattern(toPattern+"%nopex");
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/net/DilutedSMTPAppenderTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/net/DilutedSMTPAppenderTest.java
index 53bbc0c..abb5102 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/net/DilutedSMTPAppenderTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/net/DilutedSMTPAppenderTest.java
@@ -52,7 +52,7 @@ public class DilutedSMTPAppenderTest {
     appender.addTo("sebastien.nospam at qos.ch");
     appender.start();
     cbTracker = appender.getCyclicBufferTracker();
-    cb = cbTracker.get("", 0);
+    cb = cbTracker.getOrCreate("", 0);
 
   }
 
diff --git a/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java b/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
index 01f9dbe..a835638 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
@@ -175,7 +175,7 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
 
     String key = discriminator.getDiscriminatingValue(eventObject);
     long now = System.currentTimeMillis();
-    CyclicBuffer<E> cb = cbTracker.get(key, now);
+    CyclicBuffer<E> cb = cbTracker.getOrCreate(key, now);
     subAppend(cb, eventObject);
 
     try {
@@ -188,7 +188,16 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
         addError("SMTPAppender's EventEvaluator threw an Exception-", ex);
       }
     }
+
+
+    if(isEventMarkedForBufferRemoval(eventObject)) {
+      cbTracker.removeBuffer(key);
+    }
+
     cbTracker.clearStaleBuffers(now);
+
+
+
     if (lastTrackerStatusPrint + delayBetweenStatusMessages < now) {
       addInfo("SMTPAppender [" + name + "] is tracking [" + cbTracker.size() + "] buffers");
       lastTrackerStatusPrint = now;
@@ -199,6 +208,8 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
     }
   }
 
+  abstract protected boolean isEventMarkedForBufferRemoval(E eventObject);
+
   abstract protected void subAppend(CyclicBuffer<E> cb, E eventObject);
 
   /**
diff --git a/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedFileNamingAndTriggeringPolicyBase.java b/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedFileNamingAndTriggeringPolicyBase.java
index d5d4129..5328db7 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedFileNamingAndTriggeringPolicyBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedFileNamingAndTriggeringPolicyBase.java
@@ -30,9 +30,7 @@ abstract public class TimeBasedFileNamingAndTriggeringPolicyBase<E> extends
   protected String elapsedPeriodsFileName;
   protected RollingCalendar rc;
 
-  protected long currentTime;
-  // indicate whether the time has been forced or not
-  protected boolean isTimeForced = false;
+  protected long currentTime = -1;
   protected Date dateInCurrentPeriod = null;
 
   protected long nextCheck;
@@ -102,12 +100,11 @@ abstract public class TimeBasedFileNamingAndTriggeringPolicyBase<E> extends
 
   public void setCurrentTime(long timeInMillis) {
     currentTime = timeInMillis;
-    isTimeForced = true;
   }
 
   public long getCurrentTime() {
     // if time is forced return the time set by user
-    if (isTimeForced) {
+    if (currentTime >= 0) {
       return currentTime;
     } else {
       return System.currentTimeMillis();
diff --git a/logback-core/src/main/java/ch/qos/logback/core/spi/CyclicBufferTracker.java b/logback-core/src/main/java/ch/qos/logback/core/spi/CyclicBufferTracker.java
index 4f1ab45..0c9fe80 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/spi/CyclicBufferTracker.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/spi/CyclicBufferTracker.java
@@ -54,7 +54,12 @@ public interface CyclicBufferTracker<E> {
    * @param timestamp
    * @return
    */
-  CyclicBuffer<E> get(String key, long timestamp);
+  CyclicBuffer<E> getOrCreate(String key, long timestamp);
+
+  /**
+   * Remove a cyclic buffer identified by its key.
+   */
+  void removeBuffer(String key);
 
   /**
    * Clear (and detach) buffers which are stale.
diff --git a/logback-core/src/main/java/ch/qos/logback/core/spi/CyclicBufferTrackerImpl.java b/logback-core/src/main/java/ch/qos/logback/core/spi/CyclicBufferTrackerImpl.java
index a32a934..be788b1 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/spi/CyclicBufferTrackerImpl.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/spi/CyclicBufferTrackerImpl.java
@@ -13,7 +13,6 @@
  */
 package ch.qos.logback.core.spi;
 
-import ch.qos.logback.core.Appender;
 import ch.qos.logback.core.CoreConstants;
 import ch.qos.logback.core.helpers.CyclicBuffer;
 
@@ -65,7 +64,7 @@ public class CyclicBufferTrackerImpl<E> implements CyclicBufferTracker<E> {
     this.maxNumBuffers = maxNumBuffers;
   }
 
-  public CyclicBuffer<E> get(String key, long timestamp) {
+  public CyclicBuffer<E> getOrCreate(String key, long timestamp) {
     Entry existing = map.get(key);
     if (existing == null) {
       CyclicBuffer<E> cb = processNewEntry(key, timestamp);
@@ -77,12 +76,25 @@ public class CyclicBufferTrackerImpl<E> implements CyclicBufferTracker<E> {
     }
   }
 
+  public void removeBuffer(String key) {
+    Entry existing = map.get(key);
+    if (existing != null) {
+      bufferCount--;
+      map.remove(key);
+      unlink(existing);
+      CyclicBuffer<E> cb = existing.value;
+      if(cb != null) {
+        cb.clear();
+      }
+    }
+  }
+
   private CyclicBuffer<E> processNewEntry(String key, long timestamp) {
     CyclicBuffer<E> cb = new CyclicBuffer<E>(bufferSize);
     Entry entry = new Entry(key, cb, timestamp);
     map.put(key, entry);
     bufferCount++;
-    rearrangeTailLinks(entry);
+    linkBeforeTail(entry);
     if (bufferCount >= maxNumBuffers) {
       removeHead();
     }
@@ -101,11 +113,11 @@ public class CyclicBufferTrackerImpl<E> implements CyclicBufferTracker<E> {
   }
 
   private void moveToTail(Entry e) {
-    rearrangePreexistingLinks(e);
-    rearrangeTailLinks(e);
+    unlink(e);
+    linkBeforeTail(e);
   }
 
-  private void rearrangePreexistingLinks(Entry e) {
+  private void unlink(Entry e) {
     if (e.prev != null) {
       e.prev.next = e.next;
     }
@@ -125,8 +137,6 @@ public class CyclicBufferTrackerImpl<E> implements CyclicBufferTracker<E> {
     lastCheck = now;
 
     while (head.value != null && isEntryStale(head, now)) {
-      CyclicBuffer<E> cb = head.value;
-      cb.clear();
       removeHead();
     }
   }
@@ -149,7 +159,7 @@ public class CyclicBufferTrackerImpl<E> implements CyclicBufferTracker<E> {
     return result;
   }
 
-  private void rearrangeTailLinks(Entry e) {
+  private void linkBeforeTail(Entry e) {
     if (head == tail) {
       head = e;
     }
diff --git a/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTrackerImplTest.java b/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTrackerImplTest.java
index 6b9ee28..2b64b88 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTrackerImplTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTrackerImplTest.java
@@ -22,25 +22,45 @@ public class CyclicBufferTrackerImplTest {
     long now = 3000;
     tracker.clearStaleBuffers(now);
     assertEquals(0, tracker.keyList().size());
+    assertEquals(0, tracker.bufferCount);
   }
 
-    @Test
+  @Test
   public void empty1() {
     long now = 3000;
-    assertNotNull(tracker.get(key, now++));
-    now += CyclicBufferTracker.THRESHOLD+1000;
+    assertNotNull(tracker.getOrCreate(key, now++));
+    now += CyclicBufferTracker.THRESHOLD + 1000;
     tracker.clearStaleBuffers(now);
     assertEquals(0, tracker.keyList().size());
-    assertNotNull(tracker.get(key, now++));
+    assertEquals(0, tracker.bufferCount);
+
+    assertNotNull(tracker.getOrCreate(key, now++));
   }
 
   @Test
   public void smoke() {
     long now = 3000;
-    CyclicBuffer<Object> cb = tracker.get(key, now);
-    assertEquals(cb, tracker.get(key, now++));
-    now += AppenderTrackerImpl.THRESHOLD+1000;
+    CyclicBuffer<Object> cb = tracker.getOrCreate(key, now);
+    assertEquals(cb, tracker.getOrCreate(key, now++));
+    now += AppenderTrackerImpl.THRESHOLD + 1000;
     tracker.clearStaleBuffers(now);
     assertEquals(0, tracker.keyList().size());
+    assertEquals(0, tracker.bufferCount);
   }
+
+  @Test
+  public void destroy() {
+    long now = 3000;
+    CyclicBuffer<Object> cb = tracker.getOrCreate(key, now);
+    cb.add(new Object());
+    assertEquals(1, cb.length());
+    tracker.removeBuffer(key);
+    assertEquals(0, tracker.keyList().size());
+    assertEquals(0, tracker.bufferCount);
+    assertEquals(0, cb.length());
+  }
+
+
+
+
 }
diff --git a/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTrackerSimulator.java b/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTrackerSimulator.java
index 3d3e000..ff9dd98 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTrackerSimulator.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTrackerSimulator.java
@@ -20,14 +20,16 @@ import java.util.*;
  */
 public class CyclicBufferTrackerSimulator {
 
-  CyclicBufferTrackerImpl<Object> realAppenderTracker = new CyclicBufferTrackerImpl<Object>();
-  CyclicBufferTrackerImpl t_appenderTracker = new CyclicBufferTrackerImpl();
+  CyclicBufferTrackerImpl<Object> realCBTracker = new CyclicBufferTrackerImpl<Object>();
+  CyclicBufferTracker_TImpl<Object> t_CBTracker = new CyclicBufferTracker_TImpl<Object>();
 
   List<SimulationEvent> scenario = new ArrayList<SimulationEvent>();
   List<String> keySpace = new ArrayList<String>();
   int maxTimestampInc;
   Random randomKeyGen = new Random(100);
-  Random random = new Random(11234);
+  Random simulatorRandom = new Random(11234);
+
+  int deleteToInsertRatio = 10;
 
   CyclicBufferTrackerSimulator(int keySpaceLen, int maxTimestampInc) {
     this.maxTimestampInc = maxTimestampInc;
@@ -35,7 +37,7 @@ public class CyclicBufferTrackerSimulator {
     for (int i = 0; i < keySpaceLen; i++) {
       String k = getRandomKeyStr();
       if (checkMap.containsKey(k)) {
-        System.out.println("random key collision occured");
+        System.out.println("random key collision occurred");
         k += "" + i;
       }
       keySpace.add(k);
@@ -54,10 +56,15 @@ public class CyclicBufferTrackerSimulator {
     long timestamp = 30000;
     int keySpaceLen = keySpace.size();
     for (int i = 0; i < simLen; i++) {
-      int index = random.nextInt(keySpaceLen);
-      timestamp += random.nextInt(maxTimestampInc);
+      int index = simulatorRandom.nextInt(keySpaceLen);
+      timestamp += simulatorRandom.nextInt(maxTimestampInc);
+      EventType eventType = EventType.INSERT;
+      if (simulatorRandom.nextInt(deleteToInsertRatio) == 0) {
+        eventType = EventType.DELETE;
+      }
+
       String key = keySpace.get(index);
-      scenario.add(new SimulationEvent(key, timestamp));
+      scenario.add(new SimulationEvent(eventType, key, timestamp));
     }
   }
 
@@ -72,23 +79,36 @@ public class CyclicBufferTrackerSimulator {
             CyclicBufferTracker<Object> tracker) {
     String key = simulationEvent.key;
     long timestamp = simulationEvent.timestamp;
-    tracker.get(key, timestamp);
+    EventType eventType = simulationEvent.eventType;
+    switch (eventType) {
+      case INSERT:
+        tracker.getOrCreate(key, timestamp);
+        break;
+      case DELETE:
+        tracker.removeBuffer(key);
+        break;
+    }
   }
 
   public void simulate() {
     for (SimulationEvent simeEvent : scenario) {
-      play(simeEvent, realAppenderTracker);
-      play(simeEvent, t_appenderTracker);
+      play(simeEvent, realCBTracker);
+      play(simeEvent, t_CBTracker);
     }
   }
 
   // =========================================================================
+  enum EventType {
+    INSERT, DELETE;
+  }
 
   class SimulationEvent {
     final public String key;
     final public long timestamp;
+    final EventType eventType;
 
-    public SimulationEvent(String key, long timestamp) {
+    public SimulationEvent(EventType eventType, String key, long timestamp) {
+      this.eventType = eventType;
       this.key = key;
       this.timestamp = timestamp;
     }
diff --git a/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTracker_TImpl.java b/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTracker_TImpl.java
index 553104d..1d564a5 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTracker_TImpl.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/spi/CyclicBufferTracker_TImpl.java
@@ -16,8 +16,6 @@ public class CyclicBufferTracker_TImpl<E> implements CyclicBufferTracker<E> {
 
   int bufferSize = DEFAULT_BUFFER_SIZE;
   int maxNumBuffers = DEFAULT_NUMBER_OF_BUFFERS;
-  int bufferCount = 0;
-
 
   List<TEntry> entryList = new LinkedList<TEntry>();
   long lastCheck = 0;
@@ -47,12 +45,27 @@ public class CyclicBufferTracker_TImpl<E> implements CyclicBufferTracker<E> {
     return null;
   }
 
-  public CyclicBuffer<E> get(String key, long timestamp) {
+  List<String> keyList() {
+    Collections.sort(entryList);
+
+    List<String> result = new LinkedList<String>();
+    for (int i = 0; i < entryList.size(); i++) {
+      TEntry te = entryList.get(i);
+      result.add(te.key);
+    }
+    return result;
+  }
+
+
+  public CyclicBuffer<E> getOrCreate(String key, long timestamp) {
     TEntry te = getEntry(key);
     if (te == null) {
       CyclicBuffer<E> cb = new CyclicBuffer<E>(bufferSize);
       te = new TEntry<E>(key, cb, timestamp);
       entryList.add(te);
+      if (entryList.size() >= maxNumBuffers) {
+        entryList.remove(0);
+      }
       return cb;
     } else {
       te.timestamp = timestamp;
@@ -62,6 +75,16 @@ public class CyclicBufferTracker_TImpl<E> implements CyclicBufferTracker<E> {
 
   }
 
+  public void removeBuffer(String k) {
+    for (int i = 0; i < entryList.size(); i++) {
+      TEntry te = entryList.get(i);
+      if (te.key.equals(k)) {
+        entryList.remove(i);
+        return;
+      }
+    }
+  }
+
   final private boolean isEntryStale(TEntry entry, long now) {
     return ((entry.timestamp + THRESHOLD) < now);
   }
diff --git a/logback-core/src/test/java/ch/qos/logback/core/spi/ScenarioBasedCyclicBufferTrackerTest.java b/logback-core/src/test/java/ch/qos/logback/core/spi/ScenarioBasedCyclicBufferTrackerTest.java
index e48e4df..3fe7abd 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/spi/ScenarioBasedCyclicBufferTrackerTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/spi/ScenarioBasedCyclicBufferTrackerTest.java
@@ -26,9 +26,9 @@ public class ScenarioBasedCyclicBufferTrackerTest {
 
   CyclicBufferTrackerSimulator simulator;
 
-   void verify() {
-    CyclicBufferTrackerImpl<Object> at = simulator.realAppenderTracker;
-    CyclicBufferTrackerImpl<Object> t_at = simulator.t_appenderTracker;
+  void verify() {
+    CyclicBufferTrackerImpl<Object> at = simulator.realCBTracker;
+    CyclicBufferTracker_TImpl<Object> t_at = simulator.t_CBTracker;
     assertEquals(t_at.keyList(), at.keyList());
   }
 
@@ -48,7 +48,7 @@ public class ScenarioBasedCyclicBufferTrackerTest {
     verify();
   }
 
-    @Test
+  @Test
   public void longTest() {
     simulator = new CyclicBufferTrackerSimulator(128, CyclicBufferTracker.THRESHOLD / 2);
     simulator.buildScenario(200000);
diff --git a/logback-site/src/site/pages/recipes/emailPerTransaction.html b/logback-site/src/site/pages/recipes/emailPerTransaction.html
index 9573605..5eb054b 100644
--- a/logback-site/src/site/pages/recipes/emailPerTransaction.html
+++ b/logback-site/src/site/pages/recipes/emailPerTransaction.html
@@ -170,7 +170,7 @@ public class PrimeAction extends Action {
   <p>To isolate a given transaction, there must first be a way to
   distinguish it from other transactions. Typically this would be
   accomplished by putting the unique identifier of the transaction
-  into the the MDC.
+  into the MDC.
   </p>
 
   <pre class="prettyprint source">String transactionId = ...; // extract id from transaction 
@@ -236,8 +236,12 @@ MDC.put("txId", transactionId); </pre>
       <b>&lt;key>txId&lt;/key></b>
       <b>&lt;defaultValue>default&lt;/defaultValue></b>
     <b>&lt;/discriminator></b>
+  &lt;/appender>  
 
-  &lt;/appender>  </pre>
+  &lt;root level="DEBUG">
+    &lt;appender-ref ref="SMTP" /> 
+  &lt;/root>
+&lt;/configuration> </pre>
 
    <p>After starting the logback-demo web-application with the above
    configuration file (with <span class="option">smtpHost</span> and
@@ -315,8 +319,12 @@ MDC.put("txId", transactionId); </pre>
       &lt;key>uuid&lt;/key>
       &lt;defaultValue>default&lt;/defaultValue>
     &lt;/discriminator>
+  &lt;/appender>
 
-  &lt;/appender>  </pre>
+  &lt;root level="DEBUG">
+    &lt;appender-ref ref="SMTP" /> 
+  &lt;/root>
+&lt;/configuration>  </pre>
       <script src="../templates/footer.js" type="text/javascript"></script>	
     </div>
   </body>

-----------------------------------------------------------------------

Summary of changes:
 .../ch/qos/logback/access/net/SMTPAppender.java    |    5 ++-
 .../ch/qos/logback/classic/ClassicConstants.java   |    5 ++
 .../ch/qos/logback/classic/net/SMTPAppender.java   |   12 ++++++
 .../classic/net/DilutedSMTPAppenderTest.java       |    2 +-
 .../ch/qos/logback/core/net/SMTPAppenderBase.java  |   13 ++++++-
 ...TimeBasedFileNamingAndTriggeringPolicyBase.java |    7 +--
 .../qos/logback/core/spi/CyclicBufferTracker.java  |    7 +++-
 .../logback/core/spi/CyclicBufferTrackerImpl.java  |   28 +++++++++----
 .../core/spi/CyclicBufferTrackerImplTest.java      |   34 +++++++++++++---
 .../core/spi/CyclicBufferTrackerSimulator.java     |   42 ++++++++++++++-----
 .../core/spi/CyclicBufferTracker_TImpl.java        |   29 ++++++++++++-
 .../spi/ScenarioBasedCyclicBufferTrackerTest.java  |    8 ++--
 .../site/pages/recipes/emailPerTransaction.html    |   14 +++++-
 13 files changed, 160 insertions(+), 46 deletions(-)


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list