logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject svn commit: r1410726 [3/3] - in /logging/log4j/log4j2/trunk/src/site: resources/css/ xdoc/ xdoc/manual/
Date Sat, 17 Nov 2012 13:11:47 GMT
Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/flowtracing.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/flowtracing.xml?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/flowtracing.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/flowtracing.xml Sat Nov 17 13:11:44 2012
@@ -67,175 +67,178 @@
               The following example shows a simple application using these methods in a fairly typcial manner. The
               throwing() is not present since no Exceptions are explicitely thrown and not handled.
             </p>
-            <source>    package com.test;
+<pre class="prettyprint linenums">
+package com.test;
 
-    import org.apache.logging.log4j.Logger;
-    import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
 
-    import java.util.Random;
+import java.util.Random;
 
-    public class TestService {
-        private Logger logger = LogManager.getLogger(TestService.class.getName());
-
-        private String[] messages = new String[] {
-            "Hello, World",
-            "Goodbye Cruel World",
-            "You had me at hello"
-        };
-        private Random rand = new Random(1);
-
-        public String retrieveMessage() {
-            logger.entry();
-
-            String testMsg = getMessage(getKey());
-
-            return logger.exit(testMsg);
-        }
-
-        public void exampleException() {
-            logger.entry();
-            try {
-                String msg = messages[messages.length];
-                logger.error("An exception should have been thrown");
-            } catch (Exception ex) {
-                logger.catching(ex);
-            }
-            logger.exit();
+public class TestService {
+    private Logger logger = LogManager.getLogger(TestService.class.getName());
+
+    private String[] messages = new String[] {
+        "Hello, World",
+        "Goodbye Cruel World",
+        "You had me at hello"
+    };
+    private Random rand = new Random(1);
+
+    public String retrieveMessage() {
+        logger.entry();
+
+        String testMsg = getMessage(getKey());
+
+        return logger.exit(testMsg);
+    }
+
+    public void exampleException() {
+        logger.entry();
+        try {
+            String msg = messages[messages.length];
+            logger.error("An exception should have been thrown");
+        } catch (Exception ex) {
+            logger.catching(ex);
         }
+        logger.exit();
+    }
 
-        public String getMessage(int key) {
-            logger.entry(key);
-
-            String value = messages[key];
+    public String getMessage(int key) {
+        logger.entry(key);
 
-            return logger.exit(value);
-        }
+        String value = messages[key];
 
-        private int getKey() {
-            logger.entry();
-            int key = rand.nextInt(messages.length);
-            return logger.exit(key);
-        }
-    }</source>
+        return logger.exit(value);
+    }
+
+    private int getKey() {
+        logger.entry();
+        int key = rand.nextInt(messages.length);
+        return logger.exit(key);
+    }
+}</pre>
             <p>
               This test application uses the preceding service to generate logging events.
             </p>
-            <source>    package com.test;
+<pre class="prettyprint linenums">
+package com.test;
 
-    public class App {
+public class App {
 
-        public static void main( String[] args ) {
-            TestService service = new TestService();
-            service.retrieveMessage();
-            service.retrieveMessage();
-            service.exampleException();
-        }
-    }</source>
+    public static void main( String[] args ) {
+        TestService service = new TestService();
+        service.retrieveMessage();
+        service.retrieveMessage();
+        service.exampleException();
+    }
+}</pre>
             <p>
               The configuration below will cause all output to be routed to target/test.log. The pattern for
               the FileAppender includes the class name, line number and method name. Including these
               in the pattern are critical for the log to be of value.
             </p>
-            <source><![CDATA[    <?xml version="1.0" encoding="UTF-8"?>
-    <configuration status="error">
-      <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-          <ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
-          <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
-        </Console>
-        <File name="log" fileName="target/test.log" append="false">
-          <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
-        </File>
-      </appenders>
-      <loggers>
-        <root level="trace">
-          <appender-ref ref="log"/>
-        </root>
-      </loggers>
-    </configuration>]]></source>
+<pre class="prettyprint linenums"><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration status="error">
+  <appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
+      <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
+    </Console>
+    <File name="log" fileName="target/test.log" append="false">
+      <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
+    </File>
+  </appenders>
+  <loggers>
+    <root level="trace">
+      <appender-ref ref="log"/>
+    </root>
+  </loggers>
+</configuration>]]></pre>
             <p>
               Here is the output that results from the Java classes and configuration above.
             </p>
-            <source>
-    19:08:07.056 TRACE com.test.TestService 19 retrieveMessage -  entry
-    19:08:07.060 TRACE com.test.TestService 46 getKey -  entry
-    19:08:07.060 TRACE com.test.TestService 48 getKey -  exit with (0)
-    19:08:07.060 TRACE com.test.TestService 38 getMessage -  entry parms(0)
-    19:08:07.060 TRACE com.test.TestService 42 getMessage -  exit with (Hello, World)
-    19:08:07.060 TRACE com.test.TestService 23 retrieveMessage -  exit with (Hello, World)
-    19:08:07.061 TRACE com.test.TestService 19 retrieveMessage -  entry
-    19:08:07.061 TRACE com.test.TestService 46 getKey -  entry
-    19:08:07.061 TRACE com.test.TestService 48 getKey -  exit with (1)
-    19:08:07.061 TRACE com.test.TestService 38 getMessage -  entry parms(1)
-    19:08:07.061 TRACE com.test.TestService 42 getMessage -  exit with (Goodbye Cruel World)
-    19:08:07.061 TRACE com.test.TestService 23 retrieveMessage -  exit with (Goodbye Cruel World)
-    19:08:07.062 TRACE com.test.TestService 27 exampleException -  entry
-    19:08:07.077 DEBUG com.test.TestService 32 exampleException - catching java.lang.ArrayIndexOutOfBoundsException: 3
-            at com.test.TestService.exampleException(TestService.java:29) [classes/:?]
-            at com.test.App.main(App.java:9) [classes/:?]
-            at com.test.AppTest.testApp(AppTest.java:15) [test-classes/:?]
-            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_29]
-            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_29]
-            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_29]
-            at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_29]
-            at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) [junit-4.3.1.jar:?]
-            at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35) [surefire-junit4-2.7.2.jar:2.7.2]
-            at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115) [surefire-junit4-2.7.2.jar:2.7.2]
-            at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97) [surefire-junit4-2.7.2.jar:2.7.2]
-            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_29]
-            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_29]
-            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_29]
-            at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_29]
-            at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) [surefire-booter-2.7.2.jar:2.7.2]
-            at $Proxy0.invoke(Unknown Source) [?:?]
-            at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) [surefire-booter-2.7.2.jar:2.7.2]
-            at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) [surefire-booter-2.7.2.jar:2.7.2]
-            at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69) [surefire-booter-2.7.2.jar:2.7.2]
-    19:08:07.087 TRACE com.test.TestService 34 exampleException -  exit</source>
+            <pre>
+19:08:07.056 TRACE com.test.TestService 19 retrieveMessage -  entry
+19:08:07.060 TRACE com.test.TestService 46 getKey -  entry
+19:08:07.060 TRACE com.test.TestService 48 getKey -  exit with (0)
+19:08:07.060 TRACE com.test.TestService 38 getMessage -  entry parms(0)
+19:08:07.060 TRACE com.test.TestService 42 getMessage -  exit with (Hello, World)
+19:08:07.060 TRACE com.test.TestService 23 retrieveMessage -  exit with (Hello, World)
+19:08:07.061 TRACE com.test.TestService 19 retrieveMessage -  entry
+19:08:07.061 TRACE com.test.TestService 46 getKey -  entry
+19:08:07.061 TRACE com.test.TestService 48 getKey -  exit with (1)
+19:08:07.061 TRACE com.test.TestService 38 getMessage -  entry parms(1)
+19:08:07.061 TRACE com.test.TestService 42 getMessage -  exit with (Goodbye Cruel World)
+19:08:07.061 TRACE com.test.TestService 23 retrieveMessage -  exit with (Goodbye Cruel World)
+19:08:07.062 TRACE com.test.TestService 27 exampleException -  entry
+19:08:07.077 DEBUG com.test.TestService 32 exampleException - catching java.lang.ArrayIndexOutOfBoundsException: 3
+        at com.test.TestService.exampleException(TestService.java:29) [classes/:?]
+        at com.test.App.main(App.java:9) [classes/:?]
+        at com.test.AppTest.testApp(AppTest.java:15) [test-classes/:?]
+        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_29]
+        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_29]
+        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_29]
+        at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_29]
+        at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) [junit-4.3.1.jar:?]
+        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35) [surefire-junit4-2.7.2.jar:2.7.2]
+        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115) [surefire-junit4-2.7.2.jar:2.7.2]
+        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97) [surefire-junit4-2.7.2.jar:2.7.2]
+        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_29]
+        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_29]
+        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_29]
+        at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_29]
+        at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) [surefire-booter-2.7.2.jar:2.7.2]
+        at $Proxy0.invoke(Unknown Source) [?:?]
+        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) [surefire-booter-2.7.2.jar:2.7.2]
+        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) [surefire-booter-2.7.2.jar:2.7.2]
+        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69) [surefire-booter-2.7.2.jar:2.7.2]
+19:08:07.087 TRACE com.test.TestService 34 exampleException -  exit</pre>
             <p>
               Simply changing the root logger level to DEBUG in the example above will reduce the output
               considerably.
             </p>
-            <source>
-    19:13:24.963 DEBUG com.test.TestService 32 exampleException - catching java.lang.ArrayIndexOutOfBoundsException: 3
-            at com.test.TestService.exampleException(TestService.java:29) [classes/:?]
-            at com.test.App.main(App.java:9) [classes/:?]
-            at com.test.AppTest.testApp(AppTest.java:15) [test-classes/:?]
-            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_29]
-            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_29]
-            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_29]
-            at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_29]
-            at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [junit-4.3.1.jar:?]
-            at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) [junit-4.3.1.jar:?]
-            at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35) [surefire-junit4-2.7.2.jar:2.7.2]
-            at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115) [surefire-junit4-2.7.2.jar:2.7.2]
-            at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97) [surefire-junit4-2.7.2.jar:2.7.2]
-            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_29]
-            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_29]
-            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_29]
-            at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_29]
-            at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) [surefire-booter-2.7.2.jar:2.7.2]
-            at $Proxy0.invoke(Unknown Source) [?:?]
-            at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) [surefire-booter-2.7.2.jar:2.7.2]
-            at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) [surefire-booter-2.7.2.jar:2.7.2]
-            at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69) [surefire-booter-2.7.2.jar:2.7.2]</source>
+            <pre>
+19:13:24.963 DEBUG com.test.TestService 32 exampleException - catching java.lang.ArrayIndexOutOfBoundsException: 3
+        at com.test.TestService.exampleException(TestService.java:29) [classes/:?]
+        at com.test.App.main(App.java:9) [classes/:?]
+        at com.test.AppTest.testApp(AppTest.java:15) [test-classes/:?]
+        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_29]
+        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_29]
+        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_29]
+        at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_29]
+        at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) [junit-4.3.1.jar:?]
+        at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) [junit-4.3.1.jar:?]
+        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35) [surefire-junit4-2.7.2.jar:2.7.2]
+        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115) [surefire-junit4-2.7.2.jar:2.7.2]
+        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97) [surefire-junit4-2.7.2.jar:2.7.2]
+        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0_29]
+        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[?:1.6.0_29]
+        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[?:1.6.0_29]
+        at java.lang.reflect.Method.invoke(Method.java:597) ~[?:1.6.0_29]
+        at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) [surefire-booter-2.7.2.jar:2.7.2]
+        at $Proxy0.invoke(Unknown Source) [?:?]
+        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) [surefire-booter-2.7.2.jar:2.7.2]
+        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) [surefire-booter-2.7.2.jar:2.7.2]
+        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69) [surefire-booter-2.7.2.jar:2.7.2]</pre>
           </subsection>
         </section>
     </body>

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/index.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/index.xml?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/index.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/index.xml Sat Nov 17 13:11:44 2012
@@ -54,8 +54,9 @@
           viewed as an auditing tool.</p>
 
           <p>As Brian W. Kernighan and Rob Pike put it in their truly excellent
-          book <i>"The Practice of Programming"</i>
-          <pre>
+          book <i>"The Practice of Programming":</i></p>
+          
+          <div class="well">
             As personal choice, we tend not to use debuggers beyond getting a
             stack trace or the value of a variable or two. One reason is that it
             is easy to get lost in details of complicated data structures and
@@ -67,7 +68,7 @@
             the critical section of code, even assuming we know where that
             is. More important, debugging statements stay with the program;
             debugging sessions are transient.
-          </pre></p>
+          </div>
 
           <p>Logging does have its drawbacks. It can slow down an
           application. If too verbose, it can cause scrolling blindness. To

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm Sat Nov 17 13:11:44 2012
@@ -43,7 +43,7 @@
         <subsection name="HTMLLayout">
           <p>The HTMLLayout generates an HTML page and adds each LogEvent to a row in a table.
           </p>
-          <table border="1" width="100%">
+          <table>
             <tr>
               <th>Parameter Name</th>
               <th>Type</th>
@@ -106,7 +106,7 @@ WARN  [main]: Message 2</pre>
             be left justified to a width of five characters.
           </p>
 
-          <table border="1" width="100%">
+          <table>
             <tr>
               <th>Parameter Name</th>
               <th>Type</th>
@@ -139,7 +139,7 @@ WARN  [main]: Message 2</pre>
           <h4>Patterns</h4>
           <p>The conversions that are provided with Log4j are:
           </p>
-          <table border="1" width="100%">
+          <table>
             <tr>
               <th>Conversion Pattern</th>
               <th>Description</th>
@@ -160,7 +160,7 @@ WARN  [main]: Message 2</pre>
                   precision integer is less than one the right-most token will still be printed in full.
                   By default the logger name is printed in full.
                 </p>
-                <table border="1" width="100%">
+                <table>
                   <tr>
                     <th>Conversion Pattern</th>
                     <th>Logger Name</th>
@@ -228,7 +228,7 @@ WARN  [main]: Message 2</pre>
                 <p>You can also use a set of braces containing a time zone id per
                   <a href="http://docs.oracle.com/javase/6/docs/api/java/util/TimeZone.html#getTimeZone(java.lang.String)">
                     java.util.TimeZone.getTimeZone</a>. If no date format specifier is given then ISO8601 format is assumed.
-                  <table border="1" width="100%">
+                  <table>
                     <tr>
                       <th>Pattern</th>
                       <th>Example</th>
@@ -302,7 +302,7 @@ WARN  [main]: Message 2</pre>
                 <p>Adds ANSI colors to the result of the enclosed pattern based on the current event's logging level.
                 </p>
                 <p>The default colors for each level are:
-                 <table border="1" width="100%">
+                 <table>
                    <tr>
                      <th>Level</th>
                      <th>ANSI color</th>
@@ -337,7 +337,7 @@ WARN  [main]: Message 2</pre>
                 </p>
                 <p>The color and attribute names and are standard, but the exact shade, hue, or value.
                 </p>
-                <table width="100%">
+                <table>
                   <caption>Color table</caption>
                   <tbody>
                     <tr>
@@ -409,7 +409,7 @@ WARN  [main]: Message 2</pre>
                  <pre>%highlight{%d [%t] %-5level: %msg%n%throwable}{STYLE=Logback}</pre>
  #end
                  The STYLE value can be one of:
-                 <table border="1" width="100%">
+                 <table>
                    <?dbfo keep-together="auto" ?>
                    <tr>
                      <th>Style</th>
@@ -422,7 +422,7 @@ WARN  [main]: Message 2</pre>
                    <tr>
                      <td>Logback</td>
                      <td>
-                       <table border="1" width="100%">
+                       <table>
                          <tr>
                            <th>Level</th>
                            <th>ANSI color</th>
@@ -604,7 +604,7 @@ WARN  [main]: Message 2</pre>
               <td>
                 <p>Uses ANSI escape sequences to style the result of the enclosed pattern. The style can consist of
                   a comma separated list of style names from the following table.
-                  <table border="1" width="100%">
+                  <table>
                     <tr>
                       <th>Style Name</th>
                       <th>Description</th>
@@ -837,7 +837,7 @@ WARN  [main]: Message 2</pre>
           <p>Below are various format modifier examples for the category
             conversion specifier.
           </p>
-          <table BORDER="1" CELLPADDING="8">
+          <table>
             <tr>
               <th>Format modifier</th>
               <th>left justify</th>
@@ -905,15 +905,15 @@ WARN  [main]: Message 2</pre>
           <h5>Filtered Throwables</h5>
           <p>This example shows how to filter out classes from unimportant packages in stack traces.
           </p>
-          <source><![CDATA[<properties>
+          <pre class="prettyprint linenums"><![CDATA[<properties>
   <property name="filters">org.junit,org.apache.maven,sun.reflect,java.lang.reflect</property>
 </properties>
 ...
-<PatternLayout pattern="%m%xEx{filters(${dollar}{filters})}%n"/>]]></source>
+<PatternLayout pattern="%m%xEx{filters(${dollar}{filters})}%n"/>]]></pre>
           <p>The result printed to the console will appear similar to:
           </p>
  #if ($isPDF)
-          <source>Exception java.lang.IllegalArgumentException: IllegalArgument
+          <pre>Exception java.lang.IllegalArgumentException: IllegalArgument
          at org.apache.logging.log4j.core.pattern.ExtendedThrowableTest.
               testException(ExtendedThrowableTest.java:72) [test-classes/:?]
          ... suppressed 26 lines
@@ -922,23 +922,23 @@ WARN  [main]: Message 2</pre>
          Caused by: java.lang.NullPointerException: null pointer
          at org.apache.logging.log4j.core.pattern.ExtendedThrowableTest.
               testException(ExtendedThrowableTest.java:71) ~[test-classes/:?]
-         ... 30 more</source>
+         ... 30 more</pre>
  #else
-          <source>Exception java.lang.IllegalArgumentException: IllegalArgument
+          <pre class="prettyprint linenums">Exception java.lang.IllegalArgumentException: IllegalArgument
 at org.apache.logging.log4j.core.pattern.ExtendedThrowableTest.testException(ExtendedThrowableTest.java:72) [test-classes/:?]
 ... suppressed 26 lines
 at ${dollar}Proxy0.invoke(Unknown Source)} [?:?]
 ... suppressed 3 lines
 Caused by: java.lang.NullPointerException: null pointer
 at org.apache.logging.log4j.core.pattern.ExtendedThrowableTest.testException(ExtendedThrowableTest.java:71) ~[test-classes/:?]
-... 30 more</source>
+... 30 more</pre>
  #end
           <h5>ANSI Styled</h5>
           <p>The log level will be highlighted according to the event's log level. All the content that follows
             the level will be bright green.</p>
-          <source><![CDATA[<PatternLayout>
+          <pre class="prettyprint linenums"><![CDATA[<PatternLayout>
   <pattern>%d %highlight{%p} %style{%C{1.} [%t] %m}{bold,green}%n</pattern>
-</PatternLayout>]]></source>
+</PatternLayout>]]></pre>
         </subsection>
         <a name="RFC5424Layout"/>
         <subsection name="RFC5424Layout">
@@ -947,7 +947,7 @@ at org.apache.logging.log4j.core.pattern
             is primarily directed at sending messages via Syslog, this format is quite useful for
             other purposes since items are passed in the message as self-describing key/value pairs.
           </p>
-          <table border="1" width="100%">
+          <table>
             <tr>
               <th>Parameter Name</th>
               <th>Type</th>
@@ -1055,7 +1055,7 @@ at org.apache.logging.log4j.core.pattern
           <p>The SyslogLayout formats the LogEvent as BSD Syslog records matching the same format used by
             Log4j 1.2.
           </p>
-           <table border="1" width="100%">
+           <table>
             <tr>
               <th>Parameter Name</th>
               <th>Type</th>
@@ -1097,11 +1097,11 @@ at org.apache.logging.log4j.core.pattern
           <p>For example, if <code>abc</code> is the name of the file where
             the XMLLayout ouput goes, then a well-formed XML file would be:
           </p>
-          <source>&lt;?xml version="1.0" ?&gt;
+          <pre class="prettyprint linenums">&lt;?xml version="1.0" ?&gt;
 &lt;!DOCTYPE log4j:eventSet SYSTEM "log4j.dtd" [&lt;!ENTITY data SYSTEM "abc"&gt;]&gt;
 &lt;log4j:eventSet version="2.0" xmlns:log4j="http://logging.apache.org/log4j/"&gt;
 &nbsp;&nbsp;
-&lt;/log4j:eventSet&gt;</source>
+&lt;/log4j:eventSet&gt;</pre>
           <p>This approach enforces the independence of the XMLLayout and the appender where it is embedded.
           </p>
           <p>The <code>version</code> attribute helps components to correctly intrepret output generated by XMLLayout.

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/lookups.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/lookups.xml?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/lookups.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/lookups.xml Sat Nov 17 13:11:44 2012
@@ -42,11 +42,12 @@
             interpolation with Lookups and will then resolve the variable for each event.  Note that
             the pattern "%X{loginId}" would achieve the same result.
           </p>
-          <source><![CDATA[    <File name="Application" fileName="application.log">
-      <PatternLayout>
-        <pattern>%d %p %C{1.} [%t] $${ctx:loginId} %m%n</pattern>
-      </PatternLayout>
-    </File>]]></source>
+          <pre class="prettyprint linenums"><![CDATA[
+<File name="Application" fileName="application.log">
+  <PatternLayout>
+    <pattern>%d %p %C{1.} [%t] $${ctx:loginId} %m%n</pattern>
+  </PatternLayout>
+</File>]]></pre>
         </subsection>
         <a name="DateLookup"/>
         <subsection name="DateLookup">
@@ -56,13 +57,13 @@
             <a href="http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a>.
             The current date, or the date associated with the current log event will be formatted as specified.
           </p>
-          <source><![CDATA[    <RollingFile name="Rolling-${map:type}" fileName="${filename}"
-                 filePattern="target/rolling1/test1-$${date:MM-dd-yyyy}.%i.log.gz">
-      <PatternLayout>
-        <pattern>%d %p %C{1.} [%t] %m%n</pattern>
-      </PatternLayout>
-      <SizeBasedTriggeringPolicy size="500" />
-    </RollingFile>]]></source>
+          <pre class="prettyprint linenums"><![CDATA[
+<RollingFile name="Rolling-${map:type}" fileName="${filename}" filePattern="target/rolling1/test1-$${date:MM-dd-yyyy}.%i.log.gz">
+  <PatternLayout>
+    <pattern>%d %p %C{1.} [%t] %m%n</pattern>
+  </PatternLayout>
+  <SizeBasedTriggeringPolicy size="500" />
+</RollingFile>]]></pre>
         </subsection>
         <a name="EnvironmentLookup"/>
         <subsection name="EnvironmentLookup">
@@ -72,11 +73,12 @@
             from within the logging configuration. The example below includes the name of the currently logged
             in user in the application log.
           </p>
-          <source><![CDATA[    <File name="Application" fileName="application.log">
-      <PatternLayout>
-        <pattern>%d %p %C{1.} [%t] $${env:USER} %m%n</pattern>
-      </PatternLayout>
-    </File>]]></source>
+          <pre class="prettyprint linenums"><![CDATA[
+<File name="Application" fileName="application.log">
+  <PatternLayout>
+    <pattern>%d %p %C{1.} [%t] $${env:USER} %m%n</pattern>
+  </PatternLayout>
+</File>]]></pre>
         </subsection>
         <a name="MapLookup"/>
         <subsection name="MapLookup">
@@ -97,20 +99,20 @@
             <a href="./configuration.html#PropertySubstitution">Property Substitution</a> section of the
             <a href="./configuration.html">Configuration</a> page for information on how to set the default values.
           </p>
-          <source><![CDATA[    <Routing name="Routing">
-      <Routes pattern="$${map:type}">
-        <Route>
-          <RollingFile name="Rolling-${map:type}" fileName="${filename}"
-                       filePattern="target/rolling1/test1-${map:type}.%i.log.gz">
-            <PatternLayout>
-              <pattern>%d %p %C{1.} [%t] %m%n</pattern>
-            </PatternLayout>
-            <SizeBasedTriggeringPolicy size="500" />
-          </RollingFile>
-        </Route>
-      </Routes>
-    </Routing>
-          ]]></source>
+          <pre class="prettyprint linenums"><![CDATA[
+<Routing name="Routing">
+  <Routes pattern="$${map:type}">
+    <Route>
+      <RollingFile name="Rolling-${map:type}" fileName="${filename}"
+                   filePattern="target/rolling1/test1-${map:type}.%i.log.gz">
+        <PatternLayout>
+          <pattern>%d %p %C{1.} [%t] %m%n</pattern>
+        </PatternLayout>
+        <SizeBasedTriggeringPolicy size="500" />
+      </RollingFile>
+    </Route>
+  </Routes>
+</Routing>]]></pre>
         </subsection>
         <a name="StructuredDataLookup"/>
         <subsection name="StructuredDataLookup">
@@ -122,20 +124,20 @@
             <a href="../log4j-api/apidocs/org/apache/logging/log4j/message/StructuredDataMessage.html">StructuredDataMessage</a>
             while "type" would have to be an item in the Map in a MapMessage.
           </p>
-          <source><![CDATA[    <Routing name="Routing">
-      <Routes pattern="$${sd:type}">
-        <Route>
-          <RollingFile name="Rolling-${sd:type}" fileName="${filename}"
-                       filePattern="target/rolling1/test1-${sd:type}.%i.log.gz">
-            <PatternLayout>
-              <pattern>%d %p %C{1.} [%t] %m%n</pattern>
-            </PatternLayout>
-            <SizeBasedTriggeringPolicy size="500" />
-          </RollingFile>
-        </Route>
-      </Routes>
-    </Routing>
-          ]]></source>
+          <pre class="prettyprint linenums"><![CDATA[
+<Routing name="Routing">
+  <Routes pattern="$${sd:type}">
+    <Route>
+      <RollingFile name="Rolling-${sd:type}" fileName="${filename}"
+                   filePattern="target/rolling1/test1-${sd:type}.%i.log.gz">
+        <PatternLayout>
+          <pattern>%d %p %C{1.} [%t] %m%n</pattern>
+        </PatternLayout>
+        <SizeBasedTriggeringPolicy size="500" />
+      </RollingFile>
+    </Route>
+  </Routes>
+</Routing>]]></pre>
         </subsection>
         <a name="SystemPropertiesLookup"/>
         <subsection name="SystemPropertiesLookup">
@@ -144,9 +146,10 @@
             it is only natural that they should be accessible via a Lookup. As system properties are often
             defined outside the application it would be quite common to see something like:
           </p>
-          <source><![CDATA[  <appenders>
-    <File name="ApplicationLog" fileName="${sys:logPath}/app.log"/>
-  </appenders>]]></source>
+          <pre class="prettyprint linenums"><![CDATA[
+<appenders>
+  <File name="ApplicationLog" fileName="${sys:logPath}/app.log"/>
+</appenders>]]></pre>
         </subsection>
       </section>
     </body>

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/markers.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/markers.xml?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/markers.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/markers.xml Sat Nov 17 13:11:44 2012
@@ -34,47 +34,48 @@
               being executed, and wishes to be able to log queries separate from updates. One way to accomplish
               this is shown below:
             </p>
-            <source><![CDATA[    import org.apache.logging.log4j.Logger;
-    import org.apache.logging.log4j.LogManager;
-    import java.util.Map;
+        <pre class="prettyprint linenums"><![CDATA[
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import java.util.Map;
 
-    public class MyApp {
+public class MyApp {
 
-        private Logger logger = LogManager.getLogger(MyApp.class.getName());
-        private static final Marker SQL_MARKER = MarkerManager.getMarker("SQL");
-        private static final Marker UPDATE_MARKER = MarkerManager.getMarker("SQL_UPDATE", SQL_MARKER);
-        private static final Marker QUERY_MARKER = MarkerManager.getMarker("SQL_QUERY", SQL_MARKER);
+    private Logger logger = LogManager.getLogger(MyApp.class.getName());
+    private static final Marker SQL_MARKER = MarkerManager.getMarker("SQL");
+    private static final Marker UPDATE_MARKER = MarkerManager.getMarker("SQL_UPDATE", SQL_MARKER);
+    private static final Marker QUERY_MARKER = MarkerManager.getMarker("SQL_QUERY", SQL_MARKER);
 
-        public String doQuery(String table) {
-            logger.entry(param);
+    public String doQuery(String table) {
+        logger.entry(param);
 
-            logger.debug(QUERY_MARKER, "SELECT * FROM {}", table);
+        logger.debug(QUERY_MARKER, "SELECT * FROM {}", table);
 
-            return logger.exit();
-        }
+        return logger.exit();
+    }
 
-        public String doUpdate(String table, Map<String, String> params) {
-            logger.entry(param);
+    public String doUpdate(String table, Map<String, String> params) {
+        logger.entry(param);
 
-            if (logger.isDebugEnabled()) {
-              logger.debug(UPDATE_MARKER, "UPDATE {} SET {}", table, formatCols);
+        if (logger.isDebugEnabled()) {
+          logger.debug(UPDATE_MARKER, "UPDATE {} SET {}", table, formatCols);
 
-            return logger.exit();
-        }
+        return logger.exit();
+    }
 
-        private String formatCols(Map<String, String> cols) {
-            StringBuilder sb = new StringBuilder();
-            boolean first = true;
-            for (Map.Entry<String, String> entry : cols.entrySet()) {
-                if (!first) {
-                    sb.append(", ");
-                }
-                sb.append(entry.getKey()).append("=").append(entry.getValue());
-                first = false;
+    private String formatCols(Map<String, String> cols) {
+        StringBuilder sb = new StringBuilder();
+        boolean first = true;
+        for (Map.Entry<String, String> entry : cols.entrySet()) {
+            if (!first) {
+                sb.append(", ");
             }
-            return sb.toString();
+            sb.append(entry.getKey()).append("=").append(entry.getValue());
+            first = false;
         }
-    }]]></source>
+        return sb.toString();
+    }
+}]]></pre>
             <p>
               In the example above it is now possible to add MarkerFilters to only allow SQL update operations
               to be logged, all SQL updates to be logged or to log everything in MyApp.

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/messages.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/messages.xml?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/messages.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/messages.xml Sat Nov 17 13:11:44 2012
@@ -43,16 +43,12 @@
           would like to add an informational message that returns "User John Doe has logged in using id jdoe". The
           way this could be accomplished is by doing:
         </p>
-        <pre>
-          logger.info("User {} has logged in using id {}", map.get("Name"), user.getId());
-        </pre>
+        <pre class="prettyprint">logger.info("User {} has logged in using id {}", map.get("Name"), user.getId());</pre>
         <p>
           While there is nothing inherently wrong with this, as the complexity of the objects and desired output
           increases this technique becomes harder to use. As an alternative, using Messages allows:
         </p>
-        <pre>
-          logger.info(new LoggedInMessage(map, user));
-        </pre>
+        <pre class="prettyprint">logger.info(new LoggedInMessage(map, user));</pre>
         <p>
           In this alternative the formatting is delegated to the LoggedInMessage object's getFormattedMessage
           method.
@@ -70,97 +66,97 @@
           Borrowing from the earlier example illustrating Markers to identify SQL statements being logged, Messages
           can also be leveraged. First, the Message is defined.
         </p>
-        <source><![CDATA[
-
-  public class SQLMessage implements Message {
-      public enum SQLType {
-          UPDATE,
-          QUERY
-      };
-
-      prviate final SQLType type;
-      private final String table;
-      private final Map<String, String> cols;
-
-      public SQLMessage(SQLType type, String table) {
-          this(type, table, null);
-      }
-
-      public SQLMessage(SQLType type, String table, Map<String, String> cols) {
-          this.type = type;
-          this.table = table;
-          this.cols = cols;
-      }
-
-      public String getFormattedMessage() {
-          switch (type) {
-              case UPDATE:
-                return createUpdateString();
-                break;
-              case QUERY:
-                return createQueryString();
-                break;
-              default;
-          }
-      }
-
-      public String getMessageFormat() {
-          return type + " " + table;
-      }
-
-      public Object getParameters() {
-          return cols;
-      }
-
-      private String createUpdateString() {
-      }
-
-      private String createQueryString() {
-      }
-
-      private String formatCols(Map<String, String> cols) {
-          StringBuilder sb = new StringBuilder();
-          boolean first = true;
-          for (Map.Entry<String, String> entry : cols.entrySet()) {
-              if (!first) {
-                  sb.append(", ");
-              }
-              sb.append(entry.getKey()).append("=").append(entry.getValue());
-              first = false;
+        <pre class="prettyprint linenums"><![CDATA[
+public class SQLMessage implements Message {
+  public enum SQLType {
+      UPDATE,
+      QUERY
+  };
+
+  prviate final SQLType type;
+  private final String table;
+  private final Map<String, String> cols;
+
+  public SQLMessage(SQLType type, String table) {
+      this(type, table, null);
+  }
+
+  public SQLMessage(SQLType type, String table, Map<String, String> cols) {
+      this.type = type;
+      this.table = table;
+      this.cols = cols;
+  }
+
+  public String getFormattedMessage() {
+      switch (type) {
+          case UPDATE:
+            return createUpdateString();
+            break;
+          case QUERY:
+            return createQueryString();
+            break;
+          default;
+      }
+  }
+
+  public String getMessageFormat() {
+      return type + " " + table;
+  }
+
+  public Object getParameters() {
+      return cols;
+  }
+
+  private String createUpdateString() {
+  }
+
+  private String createQueryString() {
+  }
+
+  private String formatCols(Map<String, String> cols) {
+      StringBuilder sb = new StringBuilder();
+      boolean first = true;
+      for (Map.Entry<String, String> entry : cols.entrySet()) {
+          if (!first) {
+              sb.append(", ");
           }
-          return sb.toString();
+          sb.append(entry.getKey()).append("=").append(entry.getValue());
+          first = false;
       }
-  }]]></source>
+      return sb.toString();
+  }
+}]]></pre>
       <p>
         Next we can use the message in our application.
       </p>
-        <source><![CDATA[    import org.apache.logging.log4j.Logger;
-    import org.apache.logging.log4j.LogManager;
-    import java.util.Map;
+        <pre class="prettyprint linenums"><![CDATA[
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import java.util.Map;
 
-    public class MyApp {
+public class MyApp {
 
-        private Logger logger = LogManager.getLogger(MyApp.class.getName());
-        private static final Marker SQL_MARKER = MarkerManager.getMarker("SQL");
-        private static final Marker UPDATE_MARKER = MarkerManager.getMarker("SQL_UPDATE", SQL_MARKER);
-        private static final Marker QUERY_MARKER = MarkerManager.getMarker("SQL_QUERY", SQL_MARKER);
+    private Logger logger = LogManager.getLogger(MyApp.class.getName());
+    private static final Marker SQL_MARKER = MarkerManager.getMarker("SQL");
+    private static final Marker UPDATE_MARKER = MarkerManager.getMarker("SQL_UPDATE", SQL_MARKER);
+    private static final Marker QUERY_MARKER = MarkerManager.getMarker("SQL_QUERY", SQL_MARKER);
 
-        public String doQuery(String table) {
-            logger.entry(param);
+    public String doQuery(String table) {
+        logger.entry(param);
 
-            logger.debug(QUERY_MARKER, new SQLMessage(SQLMessage.SQLType.QUERY, table);
+        logger.debug(QUERY_MARKER, new SQLMessage(SQLMessage.SQLType.QUERY, table);
 
-            return logger.exit();
-        }
+        return logger.exit();
+    }
 
-        public String doUpdate(String table, Map<String, String> params) {
-            logger.entry(param);
+    public String doUpdate(String table, Map<String, String> params) {
+        logger.entry(param);
 
-            logger.debug(UPDATE_MARKER, new SQLMessage(SQLMessage.SQLType.UPDATE, table, parmas);
+        logger.debug(UPDATE_MARKER, new SQLMessage(SQLMessage.SQLType.UPDATE, table, parmas);
 
-            return logger.exit();
-        }
-    }]]></source>
+        return logger.exit();
+    }
+}]]></pre>
         <p>
           Notice that in contrast to the prior version of this example, the logger.debug in doUpdate no longer
           needs to be wrapped in an isDebugEnabled call as creation of the SQLMessage is on the same order of

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/migration.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/migration.xml?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/migration.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/migration.xml Sat Nov 17 13:11:44 2012
@@ -68,7 +68,7 @@
 
             <h4>Sample 1 - Simple configuration using a Console Appender</h4>
             <p>Log4j 1.x XML configuration</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
 <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
   <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
@@ -83,9 +83,9 @@
     <priority value ="debug" />
     <appender-ref ref="STDOUT" />
   </root>
-</log4j:configuration>]]></source>
+</log4j:configuration>]]></pre>
             <p>Log4j 2 XML configuration</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
   <appenders>
     <Console name="STDOUT" target="SYSTEM_OUT">
@@ -98,11 +98,11 @@
       <appender-ref ref="STDOUT"/>
     </root>
   </loggers>
-</configuration>]]></source>
+</configuration>]]></pre>
 
             <h4>Sample 2 - Simple configuration using a File Appender</h4>
             <p>Log4j 1.x XML configuration</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
   <appender name="A1" class="org.apache.log4j.FileAppender">
@@ -125,10 +125,10 @@
     <priority value ="debug" />
     <appender-ref ref="STDOUT" />
   </root>
-</log4j:configuration>]]></source>
+</log4j:configuration>]]></pre>
 
            <p>Log4j 2 XML configuration</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
   <appenders>
     <File name="A1" fileName="A1.log" append="false">
@@ -146,12 +146,12 @@
       <appender-ref ref="STDOUT"/>
     </root>
   </loggers>
-</configuration>]]></source>
+</configuration>]]></pre>
 
             <h4>Sample 3 - SocketAppender</h4>
             <p>Log4j 1.x XML configuration. This example from Log4j 1.x is misleading. The SocketAppender does not
               actually use a Layout. Configuring one will have no effect.</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
   <appender name="A1" class="org.apache.log4j.net.SocketAppender">
@@ -175,10 +175,10 @@
     <priority value="debug"/>
     <appender-ref ref="STDOUT"/>
   </root>
-</log4j:configuration>]]></source>
+</log4j:configuration>]]></pre>
 
            <p>Log4j 2 XML configuration</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
   <appenders>
     <Socket name="A1" host="localHost" port="5000">
@@ -196,11 +196,11 @@
       <appender-ref ref="STDOUT"/>
     </root>
   </loggers>
-</configuration>]]></source>
+</configuration>]]></pre>
 
             <h4>Sample 4 - AsynchAppender</h4>
             <p>Log4j 1.x XML configuration using the AsynchAppender.</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" configDebug="true">
   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
@@ -216,10 +216,10 @@
     <priority value="debug"/>
     <appender-ref ref="ASYNC"/>
   </root>
-</log4j:configuration>]]></source>
+</log4j:configuration>]]></pre>
 
            <p>Log4j 2 XML configuration. </p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <configuration status="debug">
   <appenders>
     <File name="TEMP" fileName="temp">
@@ -234,12 +234,12 @@
       <appender-ref ref="ASYNC"/>
     </root>
   </loggers>
-</configuration>]]></source>
+</configuration>]]></pre>
 
 
             <h4>Sample 5 - AsynchAppender with Console and File</h4>
             <p>Log4j 1.x XML configuration using the AsynchAppender.</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" configDebug="true">
   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
@@ -261,11 +261,11 @@
     <priority value="debug"/>
     <appender-ref ref="ASYNC"/>
   </root>
-</log4j:configuration>]]></source>
+</log4j:configuration>]]></pre>
 
             <p>Log4j 2 XML configuration. Note that the Asynch Appender should be configured after the appenders it
               references. This will allow it to shutdown properly.</p>
-            <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <configuration status="debug">
   <appenders>
     <Console name="CONSOLE" target="SYSTEM_OUT">
@@ -284,7 +284,7 @@
       <appender-ref ref="ASYNC"/>
     </root>
   </loggers>
-</configuration>]]></source>
+</configuration>]]></pre>
           </subsection>
         </section>
     </body>

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/plugins.xml Sat Nov 17 13:11:44 2012
@@ -109,7 +109,7 @@
           following plugin definition to your project's pom.xml will cause the plugin manager to be called during the
           build. It will store the resulting file in the correct location under the directory specified in the first
           argument after scanning all the components located under the package specified in the second argument.
-          <source><![CDATA[<plugin>
+          <pre class="prettyprint linenums"><![CDATA[<plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>exec-maven-plugin</artifactId>
   <version>1.2.1</version>
@@ -128,7 +128,7 @@
       <argument>org.myorg.myproject.log4j</argument>
     </arguments>
   </configuration>
-</plugin>]]></source>
+</plugin>]]></pre>
         </subsection>
       </section>
     </body>

Modified: logging/log4j/log4j2/trunk/src/site/xdoc/manual/thread-context.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/thread-context.xml?rev=1410726&r1=1410725&r2=1410726&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/thread-context.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/thread-context.xml Sat Nov 17 13:11:44 2012
@@ -65,35 +65,35 @@
            <p>To uniquely stamp each request using the Thread Context Stack, the user pushes contextual information
              on to the Stack.
            </p>
-            <pre>
-    ThreadContext.push(UUID.randomUUID().toString()); // Add the fishtag;
+            <pre class="prettyprint linenums">
+ThreadContext.push(UUID.randomUUID().toString()); // Add the fishtag;
 
-    logger.debug("Message 1");
-    .
-    .
-    .
-    logger.debug("Message 2");
-    .
-    .
-    ThreadContext.pop();</pre>
+logger.debug("Message 1");
+.
+.
+.
+logger.debug("Message 2");
+.
+.
+ThreadContext.pop();</pre>
           <p>
             The alternative to the Thread Context Stack is the Thread Context Map. In this case, attributes
             associated with the request being processed are adding at the beginning and removed at the end
             as follows:
           </p>
-          <pre>
-    ThreadContext.put("id", UUID.randomUUID().toString(); // Add the fishtag;
-    ThreadContext.put("ipAddress", request.getRemoteAddr());
-    ThreadContext.put("loginId", session.getAttribute("loginId"));
-    ThreadContext.put("hostName", request.getServerName());
-    .
-    logger.debug("Message 1");
-    .
-    .
-    logger.debug("Message 2");
-    .
-    .
-    ThreadContext.clear();</pre>
+          <pre class="prettyprint linenums">
+ThreadContext.put("id", UUID.randomUUID().toString(); // Add the fishtag;
+ThreadContext.put("ipAddress", request.getRemoteAddr());
+ThreadContext.put("loginId", session.getAttribute("loginId"));
+ThreadContext.put("hostName", request.getServerName());
+.
+logger.debug("Message 1");
+.
+.
+logger.debug("Message 2");
+.
+.
+ThreadContext.clear();</pre>
           <p>The Stack and the Map are managed per thread and is based on
             <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/InheritableThreadLocal.html">InheritableThreadLocal</a>.
             Thus, in many cases the contents of the Stack and Map will be passed to child threads. However, as



Mime
View raw message