[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v0.9.18-9-g0f49f98

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Thu Jan 7 00:11:11 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  0f49f9823c552f09a461c0d8cad04a3c07b37e75 (commit)
      from  75e4494c35db38d4af92ced77109deb1407ec713 (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=0f49f9823c552f09a461c0d8cad04a3c07b37e75
http://github.com/ceki/logback/commit/0f49f9823c552f09a461c0d8cad04a3c07b37e75

commit 0f49f9823c552f09a461c0d8cad04a3c07b37e75
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Thu Jan 7 00:10:01 2010 +0100

    Minor changes related to OnMarkerEvaluator

diff --git a/logback-examples/src/main/java/chapter4/mail/mailWithMarker.xml b/logback-examples/src/main/java/chapter4/mail/mailWithMarker.xml
index 4277f37..c1c7127 100644
--- a/logback-examples/src/main/java/chapter4/mail/mailWithMarker.xml
+++ b/logback-examples/src/main/java/chapter4/mail/mailWithMarker.xml
@@ -4,6 +4,8 @@
   <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
     <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
       <marker>NOTIFY_ADMIN</marker>
+      <!-- you specify add as many markers as you want -->
+      <marker>ANOTHER_MARKER</marker>
     </evaluator>
     <BufferSize>1050</BufferSize>
     <SMTPHost>${smtpHost}</SMTPHost>
diff --git a/logback-site/src/site/pages/manual/appenders.html b/logback-site/src/site/pages/manual/appenders.html
index 48c55d2..9a273c6 100644
--- a/logback-site/src/site/pages/manual/appenders.html
+++ b/logback-site/src/site/pages/manual/appenders.html
@@ -2299,8 +2299,12 @@ Context ctx = new InitialContext(env);</pre>
           </p>
           -->
 
-          <p>You can find more information on event evaluators further
-          down this document.
+          <p>Logback ships with several other evaluators, namely <a
+          href="../xref/ch/qos/logback/classic/boolex/OnMarkerEvaluator.html"><code>OnMarkerEvaluator</code></a>
+          (discussed below) and a powerful evaluator called <a
+          href="../xref/ch/qos/logback/classic/boolex/JaninoEventEvaluator.html"><code>JaninoEventEvaluator</code></a>,
+          discussed in <a href="filters.html#evalutatorFilter">another
+          chapter</a>.
           </p>
 
         </td>
@@ -2529,19 +2533,19 @@ public class CounterBasedEvaluator extends ContextAwareBase implements EventEval
   }
 }</pre>
 
-		<p>
-			Note that this implementation extends <code>ContextAwareBase</code> and
-			implements <code>EventEvaluator</code>. This allows the user to concentrate
-			on the core functions of her <code>EventEvaluator</code> and let the base class
-			provide the common functionality.
+		<p>Note that this class extends <code>ContextAwareBase</code> and
+		implements <code>EventEvaluator</code>. This allows the user to
+		concentrate on the core functions of her
+		<code>EventEvaluator</code> and let the base class provide the
+		common functionality.
 		</p>
 
-		<p>
-			Setting the <span class="option">EventEvaluator</span> option of 
-			<code>SMTPAppender</code> instructs it to use a custom evaluator. 
-			The next configuration file attaches a <code>SMTPAppender</code> to the root logger. 
-			This appender has a buffer size of 2048 and uses a <code>CounterBasedEvaluator</code> instance 
-			as its event evaluator.
+		<p>Setting the <span class="option">Evaluator</span> option of
+		<code>SMTPAppender</code> instructs it to use a custom evaluator.
+		The next configuration file attaches a <code>SMTPAppender</code>
+		to the root logger.  This appender has a buffer size of 2048 and
+		uses a <code>CounterBasedEvaluator</code> instance as its event
+		evaluator.
 		</p>
 
 <em>Example 4.<span class="autoEx"/>: <code>SMTPAppender</code> with custom 
@@ -2584,10 +2588,14 @@ public class CounterBasedEvaluator extends ContextAwareBase implements EventEval
     </p>
 
     <pre class="prettyprint source">Marker notifyAdminMarker = MarkerFactory.getMarker("NOTIFY_ADMIN");
-logger.error(notifyAdminMarker,
+logger.error(<b>notifyAdminMarker</b>,
   "This is a serious an error requiring the admin's attention",
    new Exception("Just testing"));</pre>
-    
+
+   <p>The next configuration file will cause outgoing emails to be
+   sent only in presensce of events bearing the NOTIFY_ADMIN or the
+   TRANSACTION_FAILURE marker.
+   </p>
 
    <em>Example 4.<span class="autoEx"/>: <code>SMTPAppender</code> with 
    <code>OnMarkerEvaluator</code> (logback-examples/src/main/java/chapter4/mail/mailWithMarker.xml)</em>
@@ -2596,6 +2604,8 @@ logger.error(notifyAdminMarker,
   &lt;appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
     <b>&lt;evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
       &lt;marker>NOTIFY_ADMIN&lt;/marker>
+      &lt;!-- you specify add as many markers as you want -->
+      &lt;marker>TRANSACTION_FAILURE&lt;/marker>
     &lt;/evaluator></b>
     &lt;BufferSize>1050&lt;/BufferSize>
     &lt;SMTPHost>${smtpHost}&lt;/SMTPHost>
@@ -2610,6 +2620,11 @@ logger.error(notifyAdminMarker,
   &lt;/root>  
 &lt;/configuration></pre>
     
+    <p>Give it a whirl with the following command:</p>
+
+    <pre class="source">java -Dfrom=source at xyz.com -Dto=recipient at xyz.com -DsmtpHost=some_smtp_host \
+  chapter4.mail.Marked_EMail src/main/java/chapter4/mail/mailWithMarker.xml</pre>
+
 
     
     <h3><a name="smtpAuthentication"
diff --git a/logback-site/src/site/pages/news.html b/logback-site/src/site/pages/news.html
index 94525d4..b11639d 100644
--- a/logback-site/src/site/pages/news.html
+++ b/logback-site/src/site/pages/news.html
@@ -28,6 +28,17 @@
 
     <hr width="80%" align="center" />
 
+    <h3>January 2010 - Release of version 0.9.19</h3>
+
+    <p>Added <a
+    href="manual/appenders.html#OnMarkerEvaluator">OnMarkerEvaluator</a>
+    which evaluates to true in the presence of user-specified
+    markers. When used with <code>SMTPAppender</code>, it can trigger
+    an outgoing email message when an event matches user-specified
+    marker.</p>
+
+    <hr width="80%" align="center" />
+
     <h3>3rd of December 2009 - Release of version 0.9.18</h3>
 
     <p>After a very long investigation resulting in somewhat a better

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

Summary of changes:
 .../src/main/java/chapter4/mail/mailWithMarker.xml |    2 +
 logback-site/src/site/pages/manual/appenders.html  |   45 +++++++++++++-------
 logback-site/src/site/pages/news.html              |   11 +++++
 3 files changed, 43 insertions(+), 15 deletions(-)


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


More information about the logback-dev mailing list