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

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Fri Mar 12 22:37:42 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  49e948fd49e0c62c325320b700c28db219be8314 (commit)
      from  7ffb4f83eb56a595d6757c58aae0812d2686ac4d (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=49e948fd49e0c62c325320b700c28db219be8314
http://github.com/ceki/logback/commit/49e948fd49e0c62c325320b700c28db219be8314

commit 49e948fd49e0c62c325320b700c28db219be8314
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Fri Mar 12 22:37:03 2010 +0100

    - continued work on the docs

diff --git a/logback-core/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java b/logback-core/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java
index 43282dc..5ee84d0 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/html/HTMLLayoutBase.java
@@ -169,11 +169,7 @@ public abstract class HTMLLayoutBase<E> extends LayoutBase<E> {
     sbuf.append(LINE_SEPARATOR);
     
     cssBuilder.addCss(sbuf);
-//    if (cssBuilder == null) {
-//      DefaultCssBuilder.addDefaultCSS(sbuf);
-//    } else {
-//      cssBuilder.addExternalCSS(sbuf);
-//    }
+
     sbuf.append(LINE_SEPARATOR);
     sbuf.append("  </head>");
     sbuf.append(LINE_SEPARATOR);
diff --git a/logback-examples/src/main/java/chapters/layouts/log4jXMLLayout.xml b/logback-examples/src/main/java/chapters/layouts/log4jXMLLayout.xml
new file mode 100644
index 0000000..034162e
--- /dev/null
+++ b/logback-examples/src/main/java/chapters/layouts/log4jXMLLayout.xml
@@ -0,0 +1,14 @@
+<configuration>
+  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+    <file>test.xml</file>
+    <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+      <layout class="ch.qos.logback.classic.log4j.XMLLayout">
+        <locationInfo>true</locationInfo>
+      </layout>
+    </encoder> 
+  </appender> 
+
+  <root level="DEBUG">
+    <appender-ref ref="FILE" />
+  </root>
+</configuration> 
\ No newline at end of file
diff --git a/logback-site/src/site/pages/faq.html b/logback-site/src/site/pages/faq.html
index d5ab5b9..12f8427 100644
--- a/logback-site/src/site/pages/faq.html
+++ b/logback-site/src/site/pages/faq.html
@@ -26,9 +26,8 @@
     <h3>Logback project</h3>
 
     <ol>
-      <li><a href="#why_lgpl">Why is logback distributed under LGPL and
-      not the Apache Software License?</a>
-      </li>
+      <li><a href="#why_lgpl">Why is logback distributed under LGPL
+      and not the Apache Software License?</a> </li>
 
       <li><a href="#dependecy">What are logback's dependencies, i.e.
       JDK version and third-party libraries?</a>
@@ -86,24 +85,30 @@
       <h2>Logback project</h2>
       
       <dl>
-        <dt> 
-          <a name="why_lgpl" href="#why_lgpl">Why is logback distributed
-          under LGPL and not the Apache Software License?</a>
-        </dt>
+        <dt>
+          <a name="why_lgpl" href="#why_lgpl">Why is logback
+          distributed under LGPL and not the Apache Software License
+          (ASL)?</a> </dt>
         
         <dd>
-          <p>The logback project is distributed under the LGPL license
-          in order to emphasize the fact that it is a related but
-          <em>different</em> project than log4j.
+          <p>The logback project is dual licensed under the LGPL and
+          the EPL for two mains reasons. For one, the different
+          license emphasizes that the fact that logback is a related
+          but <em>different</em> project than log4j. 
           </p>
 
-          <p>Given that Java v7 will be distributed under GPL, we expect
-          GPL and LGPL to become even more prevalent in the Java world.
+          <p>Both the LGPL and EPL are reasonable and widely-accepted
+          licenses. In contrast to the ASL, both the LGPL and he EPL
+          require that derivate work be licensed under the same
+          license. While there might be debate about the exact
+          definition of derivative work, we find such reciprocity both
+          justified and morally appealing -- that tis the second
+          reason for our choice of the LGPL &amp; EPL
+          dual-license. The subtly more liberal approach embodied in
+          the ASL is not necessarily wrong. It is the expression of a
+          different balance.
           </p>
           
-          <p>In short, LGPL is a reasonable and widely-accepted
-          license. Let well alone.
-          </p>
         </dd>
       </dl>
 
diff --git a/logback-site/src/site/pages/manual/layouts.html b/logback-site/src/site/pages/manual/layouts.html
index 7021214..f91d654 100644
--- a/logback-site/src/site/pages/manual/layouts.html
+++ b/logback-site/src/site/pages/manual/layouts.html
@@ -88,7 +88,7 @@
 		<div class="source">10489 DEBUG [main] com.marsupial.Pouch - Hello world.</div>
 
 		<p>Here is a possible implementation, authored by the Texan developer:</p>
-		<em>Example 5.0: Sample implementation of a Layout
+		<em>Example: Sample implementation of a Layout
 			<a href="../xref/chapters/layouts/MySampleLayout.html">
 			(logback-examples/src/main/java/chapters/layouts/MySampleLayout.java)</a></em>
 
@@ -328,7 +328,7 @@ public class MySampleLayout2 extends LayoutBase&lt;ILoggingEvent> {
 
  
 		<em>
-			Example 5.1: Sample usage of a PatternLayout
+			Example: Sample usage of a PatternLayout
 			<a href="../xref/chapters/layouts/PatternSample.html">
 			(logback-examples/src/main/java/chapters/layouts/PatternSample.java)</a>
 		</em>
@@ -1271,7 +1271,7 @@ Caller+2   at mainPackage.ConfigTester.main(ConfigTester.java:38)</pre>
     document.</p>
 
 		<em>
-			Example 5.2: Sample usage of EventEvaluators
+			Example: Sample usage of EventEvaluators
 			(logback-examples/src/main/java/chapters/layouts/callerEvaluatorConfig.xml)
 		</em>
 		<pre class="prettyprint source">&lt;configuration>
@@ -1303,7 +1303,7 @@ Caller+2   at mainPackage.ConfigTester.main(ConfigTester.java:38)</pre>
     mentioned in above configuration file.</p>
 		
     <p><em>
-			Example 5.2: Sample usage of EventEvaluators
+			Example: Sample usage of EventEvaluators
 			<a href="../xref/chapters/layouts/CallerEvaluatorExample.html">
 			(logback-examples/src/main/java/chapters/layouts/CallerEvaluatorExample.java)</a>
 		</em>
@@ -1397,7 +1397,7 @@ Caller+0   at chapters.layouts.CallerEvaluatorExample.main(CallerEvaluatorExampl
 		printed.</p>
 
    <p><em>
-			Example 5.2: Sample usage of EventEvaluators
+			Example: Sample usage of EventEvaluators
 			<a href="../xref/chapters/layouts/ExceptionEvaluatorExample.html">
 			(logback-examples/src/main/java/chapters/layouts/ExceptionEvaluatorExample.java)</a>
 		</em>
@@ -1446,7 +1446,7 @@ public class ExceptionEvaluatorExample {
     </p>
 
 		<em>
-			Example 5.3: Sample usage of EventEvaluators
+			Example: Sample usage of EventEvaluators
 			(logback-examples/src/main/java/chapters/layouts/exceptionEvaluatorConfig.xml)
 		</em>
 		<pre class="prettyprint source">&lt;configuration>
@@ -1527,7 +1527,7 @@ java.lang.Exception: display
 		colors the level of the logging event, according to ANSI terminal
 		conventions. Here is a possible implementation:</p>
 		
-<em> Example 5.4: Sample Converter Example 
+<em> Example: Sample Converter Example 
 <a href="../xref/chapters/layouts/MySampleConverter.html">
 (src/main/java/chapters/layouts/MySampleConverter.java)</a></em>
 <pre class="prettyprint source">package chapters.layouts;
@@ -1580,7 +1580,7 @@ public class MySampleConverter extends ClassicConverter {
 		<code>Converter</code>. For this purpose, we need to declare the
 		new conversion word in the configuration file, as shown below:</p>
 		
-<em> Example 5.4: Sample Converter Example (src/main/java/chapters/layouts/mySampleConverterConfig.xml)</em>
+<em> Example: Sample Converter Example (src/main/java/chapters/layouts/mySampleConverterConfig.xml)</em>
 <pre class="prettyprint source">&lt;configuration>
 
   <b>&lt;conversionRule conversionWord="sample" 
@@ -1663,6 +1663,7 @@ public class MySampleConverter extends ClassicConverter {
     the use of <code>HTMLLayout</code>.
     </p>
 
+<em> Example: HTMLLayout Example (src/main/java/chapters/layouts/htmlLayoutConfig1.xml)</em>
 <pre class="prettyprint source">&lt;configuration debug="true"&gt;
   &lt;appender name="FILE" class="ch.qos.logback.core.FileAppender"&gt;
     &lt;encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
@@ -1679,29 +1680,12 @@ public class MySampleConverter extends ClassicConverter {
 &lt;/configuration>
 </pre>
 
-   <p>The next application logs a few messages finishing with an
-   exception.</p>
-  
-  <pre class="prettyprint source">import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TrivialMain {
-  public static void main(String[] args) throws InterruptedException {
-    Logger logger = LoggerFactory.getLogger(TrivialMain.class);
-    for(int i = 0; i &lt; 6; i ++) {
-      if(i % 5 == 0) {
-        logger.warn("a warning message "+i);
-      } else {
-        logger.debug("hello world number" +i);
-      }
-    }
-    logger.error("Finish off with fireworks", new Exception("Just testing"));
-  }
-}</pre>
+   <p>The <a
+   href="../xref/chapters/layouts/TrivialMain.html">TrivialMain</a>
+   application logs a few messages finishing with an exception. The
+   commmand:</p>
 
-   <p>The command</p>
-
-  <p class="source">java chapters.layouts.TrivialMain src/main/java/chapters/appenders/conf/logback-HtmlToConsole.xml</p>
+   <p class="source">java chapters.layouts.TrivialMain src/main/java/chapters/layouts/htmlLayoutConfig1.xml</p>
 
     <p>will create the file <em>test.html</em> in the current
     folder. The contents of <em>test.html</em> should be similar to:
@@ -1750,64 +1734,19 @@ public class TrivialMain {
     <code>&lt;layout&gt;</code> element, as shown below.
 		</p>
 
-<pre class="prettyprint source">&lt;layout>
-  ...
+<pre class="prettyprint source">&lt;layout class="ch.qos.logback.classic.html.HTMLLayout">
+  &lt;pattern>%relative...%msg&lt;/pattern>
   &lt;cssBuilder class="ch.qos.logback.core.html.UrlCssBuilder">
-    &lt;url>path_to_StyleFile.css&lt;/url>
+    &lt;!-- url where the css file is located --&gt;
+    &lt;url>http://...&lt;/url>
   &lt;/cssBuilder>	
-  ...
 &lt;/layout></pre>
 
 	
 		<p>The <code>HTMLLayout</code> is often used in conjunction with
-		<code>SMTPAppender</code>, in order to send an email pleasantly
-		formatted in HTML. Here is a typical configuration:
+		<code>SMTPAppender</code> so that outgoing email is pleasantly
+		formatted in HTML.
 		</p>
-
-		<pre class="prettyprint source">&lt;configuration&gt;
-  &lt;appender name="SMTP" class="ch.qos.logback.classic.net.SMTPAppender"&gt;
-    &lt;layout class="ch.qos.logback.classic.html.HTMLLayout"&gt;
-      &lt;pattern>%relative%thread%mdc%level%class%msg&lt;/pattern&gt;
-    &lt;/layout&gt;
-    &lt;From>sender.email at domain.net&lt;/From>
-    &lt;SMTPHost>mail.domain.net&lt;/SMTPHost>
-    &lt;Subject>LastEvent: %class - %msg &lt;/Subject>
-    &lt;To>destination.email at domain.net&lt;/To> 
-  &lt;/appender&gt;
-
-  &lt;root level="debug">
-    &lt;appender-ref ref="SMTP" /&gt;
-  &lt;/root&gt;
-&lt;/configuration&gt;</pre>
-
-		<p><code>HTMLLayout</code> can also be used with any
-		<code>FileAppender</code>, including a a rolling file appender, as
-		shown in the sample configuration below.
-    </p>
-		
-    <pre class="prettyprint source">&lt;configuration>
-  &lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-    &lt;file>lastLogEntries.html&lt;/file>
-    &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-      &lt;fileNamePattern>logEntries.%d{yyyy-MM-dd}.log&lt;/fileNamePattern>
-    &lt;/rollingPolicy>
-
-    &lt;encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
-       &lt;layout class="ch.qos.logback.classic.html.HTMLLayout">
-         &lt;cssBuilder class="ch.qos.logback.core.html.UrlCssBuilder">
-           &lt;url>address_of_a_custom_stylesheet.css&lt;/url>
-         &lt;/cssBuilder>	
-         &lt;pattern>%relative%thread%mdc%level%logger%msg&lt;/pattern>
-         <b>&lt;title>Logging Events&lt;/title></b>
-      &lt;/layout>
-    &lt;/encoder>
-  &lt;/appender> 
-
-  &lt;root level="DEBUG">
-    &lt;appender-ref ref="FILE" />
-  &lt;/root>
-&lt;/configuration></pre>
-
     <h2><a name="log4jXMLLayout" href="#log4jXMLLayout">Log4j
     XMLLayout</a></h2>
 
@@ -1815,8 +1754,7 @@ public class TrivialMain {
     <p><a
     href="../xref/ch/qos/logback/classic/log4j/XMLLayout.html">XMLLayout</a>
     (part of logback-classic) generates output in a log4j.dtd
-    compliant format. It can be used to inter-operate with tools such
-    as <a
+    compliant format to interoperate with tools such as <a
     href="http://logging.apache.org/chainsaw/index.html">Chainsaw</a>
     and <a href="http://vigilog.sourceforge.net/">Vigilog</a> capable
     of processing files generated by <a
@@ -1837,6 +1775,7 @@ public class TrivialMain {
 
     <p>Here is a sample configuration</p>
 
+<em> Example: Log4jXMLLayout Example (src/main/java/chapters/layouts/log4jXMLLayout.xml)</em>
     <pre class="prettyprint source">&lt;configuration>
   &lt;appender name="FILE" class="ch.qos.logback.core.FileAppender">
     &lt;file>test.xml&lt;/file>
@@ -1852,7 +1791,7 @@ public class TrivialMain {
   &lt;/root>
 &lt;/configuration> </pre>
     
-		<h2>Logback access</h2>
+		<h1><a name="logback-access" href="#logback-access">Logback access</a></h1>
 
 		<p>Most logback-access layouts are mere adaptations of
 		logback-classic layouts. Logback-classic and logback-access

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

Summary of changes:
 .../ch/qos/logback/core/html/HTMLLayoutBase.java   |    6 +-
 .../{htmlLayoutConfig1.xml => log4jXMLLayout.xml}  |   12 +-
 logback-site/src/site/pages/faq.html               |   35 ++++---
 logback-site/src/site/pages/manual/layouts.html    |  107 ++++---------------
 4 files changed, 50 insertions(+), 110 deletions(-)
 copy logback-examples/src/main/java/chapters/layouts/{htmlLayoutConfig1.xml => log4jXMLLayout.xml} (54%)


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


More information about the logback-dev mailing list