[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch master updated. v_0.9.30-37-g1c1e6e5

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Fri Oct 21 19:15:48 CEST 2011


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  1c1e6e5b44a7fb1d3898378161152f7e534c9e10 (commit)
      from  04c818e490672640ec22946276613d6a6b26f6fc (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=1c1e6e5b44a7fb1d3898378161152f7e534c9e10
http://github.com/ceki/logback/commit/1c1e6e5b44a7fb1d3898378161152f7e534c9e10

commit 1c1e6e5b44a7fb1d3898378161152f7e534c9e10
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Fri Oct 21 19:14:50 2011 +0200

    add missing error code for appender definition/reference ordering

diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderRefAction.java b/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderRefAction.java
index f2e8fc4..104e09c 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderRefAction.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/action/AppenderRefAction.java
@@ -63,7 +63,7 @@ public class AppenderRefAction extends Action {
 
     if (appender == null) {
       String msg = "Could not find an appender named [" + appenderName
-          + "]. Did you define it below in the config file?";
+          + "]. Did you define it below instead of above in the configuration file?";
       inError = true;
       addError(msg);
       addError("See " + CoreConstants.CODES_URL
diff --git a/logback-site/src/site/pages/codes.html b/logback-site/src/site/pages/codes.html
index 29537e5..fdd3693 100644
--- a/logback-site/src/site/pages/codes.html
+++ b/logback-site/src/site/pages/codes.html
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
@@ -532,6 +533,62 @@ return false;</pre>
    <b>\(</b>%d{HH:mm:ss.SSS} [%thread]<b>\) </b>.
    </p>
   
+
+  <p>
+   </p>
+   <hr/>
+   <!-- ============================================================= -->
+   <p><a name="appender_order" href="#appender_order">Appenders must
+   be definied before they are referenced.</a>
+   </p>
+   
+   <p>In a configuration file, at the point where an appender is
+   referenced by name, it must be defined earlier in the configuration
+   file. Referencing an appender defined later in the file is not
+   allowed. Below are examples of correct and incorrect order of
+   definition and referece.
+   </p>
+
+
+  <p>Below is an example of a correct ordering, where appender
+  definition precedes references made to it.
+  </p>
+
+  <p class="green bold">CORRECT ORDER</p>
+  <pre class="prettyprint source"><configuration>
+  <b><!-- definition of appender STDOUT --></b>
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
+    </encoder>
+  </appender>
+
+  <root level="DEBUG">
+    <!-- appender referenced after it is defined -->
+    <b class="big"><appender-ref ref="STDOUT"/></b>
+  </root> 
+</configuration></pre>
+
+  <p>Below is an example of an incorrect ordering, where appender
+  definition follows references made to it.
+  </p>
+
+   <p class="red bold">INCORRECT ORDER</p>
+   <pre class="prettyprint source"><configuration>
+  <root level="DEBUG">
+    <!-- appender INCORRECTLY referenced before it is defined -->
+    <b class="big"><appender-ref ref="STDOUT"/></b>
+  </root>
+
+  <b><!-- definition of appender STDOUT --></b>
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
+    </encoder>
+  </appender>
+</configuration>
+   </pre>
+
   <script src="templates/footer.js" type="text/javascript"></script>
   </div>
 </body>

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

Summary of changes:
 .../core/joran/action/AppenderRefAction.java       |    2 +-
 logback-site/src/site/pages/codes.html             |   57 ++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletions(-)


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


More information about the logback-dev mailing list