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

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Thu Nov 4 19:19:29 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  cc94d919ec6ce8cc90e1e3a0cd8f26c52f27ee47 (commit)
      from  1869d32c56f08e2a1af168ddf82219a37f05f633 (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=cc94d919ec6ce8cc90e1e3a0cd8f26c52f27ee47
http://github.com/ceki/logback/commit/cc94d919ec6ce8cc90e1e3a0cd8f26c52f27ee47

commit cc94d919ec6ce8cc90e1e3a0cd8f26c52f27ee47
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Thu Nov 4 19:18:13 2010 +0100

    on going work on th emailPerTransaction recipe

diff --git a/logback-site/src/site/pages/recipes/emailPerTransaction.html b/logback-site/src/site/pages/recipes/emailPerTransaction.html
index d324f5c..74272ad 100644
--- a/logback-site/src/site/pages/recipes/emailPerTransaction.html
+++ b/logback-site/src/site/pages/recipes/emailPerTransaction.html
@@ -8,10 +8,12 @@
     <link rel="stylesheet" type="text/css" href="../css/common.css" />
     <link rel="stylesheet" type="text/css" href="../css/screen.css" media="screen" />
     <link rel="stylesheet" type="text/css" href="../css/_print.css" media="print" />
+    <link rel="stylesheet" type="text/css" href="../css/prettify.css" media="screen" />
 
   </head>
-  <body>
+  <body onload="prettyPrint()">
     <script type="text/javascript">prefix='../';</script>
+    <script type="text/javascript" src="../js/prettify.js"></script>
     <script src="../templates/header.js" type="text/javascript"></script>
     <div id="left">
       <noscript>Please turn on Javascript to view this menu</noscript>
@@ -21,38 +23,100 @@
       
       <h2>Send an email per transaction but only for certain users</h2>
       
-      <p>Let Dave be a developper working on some business critical
-      software called Buscrit. Tata is a QA-enginner who needs to test
-      Buscrit on a regular basis.
+      <p>Let Dave and Tata be software engineers working at a company
+      called Fooware.com. As you might have guessed, Fooware.com sells
+      foos. Yes, foos. Let <em>Buscrit</em> be a business critical
+      back-end system running at Fooware.com. Buscrit is called by a
+      number of applications to make business-critical transactions of
+      various types.
       </p>
 
-      <p>Let us further assume that Buscrit deals 
+      <p>We would like to allow Tata, a QA-engineer, to access the
+      logging data generated by Buscrit as conveniently as
+      possible. Tata could access the log files directly on the server
+      where Buscrit runs. Let us assume that accessing the log files
+      is impractical because one of the following conditions holds
+      true:
+      </p>
+
+      <ol>
+        <li>Buscrit runs on several hosts and it is difficult to
+        identify the host where a particular transaction was
+        executed</li>
+        <li>Tata does not (or does not wish to) have access to the
+        hosts where Byscrit runs
+        </li>
+        <li>Buscrit is tested by half a dozen testers simultanesouly
+        so that it is hard to indetify and track an individual
+        transaction in the log files
+        </li>
+      </ol>
+
+      <p>Given the above circumstances, let us create a setup so that
+      Tata receives an email message containing the logs generated by
+      a single transaction as shown next. We will later refine the
+      setup so that Tata reveies an email per transaction but only for
+      the transactions she explicitly selects.
+      </p>
+
+      <h3>Generating an email message containing the logs of a single
+      transaction
+      </h3>
+
+      <pre class="prettyprint source">&lt;configuration scan="true" scanPeriod="3 seconds">
+
+  &lt;statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
 
- <appender name="SMTP" class="ch.qos.logback.classic.net.SMTPAppender">
-    <SMTPHost>smtp.nespresso.com</SMTPHost>
-    <To>com</To>
-    <From></From>
-    <layout class="ch.qos.logback.classic.html.HTMLLayout">
-       <pattern>%date%level%logger{24}%msg</pattern>
-    </layout>
+  &lt;appender name="SMTP" class="ch.qos.logback.classic.net.SMTPAppender">
+    &lt;SMTPHost>NAME_OF_SMTP_HOST&lt;/SMTPHost>
+    &lt;To>...&lt;/To>
+    &lt;From>...&lt;/From>
+    &lt;layout class="ch.qos.logback.classic.html.HTMLLayout">
+      &lt;pattern>%date%level%logger{24}%msg&lt;/pattern>
+    &lt;/layout>
+    &lt;evaluator class="ch.qos.logback.classic.boolex.JaninoEventEvaluator">
+      &lt;expression>
+        marker != null  &amp;&amp; marker.contains("SMTP_TRIGGER") 
+      &lt;/expression>
+    &lt;/evaluator>    
+  &lt;/appender>
 
-    <evaluator class="ch.qos.logback.classic.boolex.JaninoEventEvaluator">
-      <expression>
+  &lt;root level="DEBUG">
+    &lt;appender-ref ref="SMTP" /> 
+  &lt;/root>
+
+&lt;/configuration></pre>
+      
+  <pre>
+ &lt;appender name="SMTP" class="ch.qos.logback.classic.net.SMTPAppender">
+    &lt;SMTPHost>NAME_OF_SMTP_HOST&lt;/SMTPHost>
+    &lt;To>com&lt;/To>
+    &lt;From>&lt;/From>
+    &lt;layout class="ch.qos.logback.classic.html.HTMLLayout">
+       &lt;pattern>%date%level%logger{24}%msg&lt;/pattern>
+    &lt;/layout>
+
+    &lt;discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
+      &lt;key>uuid&lt;/key>
+      &lt;defaultValue>default&lt;/defaultValue>
+    &lt;/discriminator>
+
+    &lt;evaluator class="ch.qos.logback.classic.boolex.JaninoEventEvaluator">
+      &lt;expression>
         (mdc != null &amp;&amp; mdc.get("txUser") != null &amp;&amp; 
              ((String) mdc.get("txUser")).contains("Mickey") )
         &amp;&amp;
         (marker != null  &amp;&amp; marker.contains("SMTP_TRIGGER") )
-      </expression>
-    </evaluator>
-
-    <discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
-      <key>uuid</key>
-      <defaultValue>default</defaultValue>
-    </discriminator>
-
+      &lt;/expression>
+    &lt;/evaluator>
 
-  </appender>
+    &lt;discriminator class="ch.qos.logback.classic.sift.MDCBasedDiscriminator">
+      &lt;key>uuid&lt;/key>
+      &lt;defaultValue>default&lt;/defaultValue>
+    &lt;/discriminator>
 
+  &lt;/appender>
+  </pre>
       <script src="../templates/footer.js" type="text/javascript"></script>	
     </div>
   </body>
diff --git a/pom.xml b/pom.xml
index 4a90902..3d6af6d 100755
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,8 @@
          logback-classic/pom.xml and in setClasspath.cmd -->
     <slf4j.version>1.6.1</slf4j.version>
     <junit.version>4.7</junit.version>
-
+    <janino.version>2.5.10</janino.version>
+        
     <consolePlugin.version>1.1.0</consolePlugin.version>  
   </properties>
 
@@ -88,7 +89,7 @@
       <dependency>
         <groupId>janino</groupId>
         <artifactId>janino</artifactId>
-        <version>2.5.10</version>
+        <version>${janino.version}</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.groovy</groupId>

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

Summary of changes:
 .../site/pages/recipes/emailPerTransaction.html    |  110 +++++++++++++++----
 pom.xml                                            |    5 +-
 2 files changed, 90 insertions(+), 25 deletions(-)


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


More information about the logback-dev mailing list