logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1407215 - in /logging/log4j/log4j2/trunk: pom.xml src/site/resources/pdf-config.xml src/site/xdoc/manual/configuration.xml src/site/xdoc/manual/configuration.xml.vm src/site/xdoc/manual/layouts.xml src/site/xdoc/manual/layouts.xml.vm
Date Thu, 08 Nov 2012 19:03:15 GMT
Author: rgoers
Date: Thu Nov  8 19:03:14 2012
New Revision: 1407215

URL: http://svn.apache.org/viewvc?rev=1407215&view=rev
Log:
Fix issues in pdf generation

Added:
    logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm
      - copied, changed from r1406189, logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml
    logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm
      - copied, changed from r1406189, logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml
Removed:
    logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml
    logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml
Modified:
    logging/log4j/log4j2/trunk/pom.xml
    logging/log4j/log4j2/trunk/src/site/resources/pdf-config.xml

Modified: logging/log4j/log4j2/trunk/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/pom.xml?rev=1407215&r1=1407214&r2=1407215&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/pom.xml (original)
+++ logging/log4j/log4j2/trunk/pom.xml Thu Nov  8 19:03:14 2012
@@ -117,6 +117,10 @@
       <id>apache.snapshots</id>
       <url>http://repository.apache.org/snapshots/</url>
     </pluginRepository>
+    <pluginRepository>
+      <id>maven.snapshots</id>
+      <url>https://repository.apache.org/content/repositories/maven-018/</url>
+    </pluginRepository>
   </pluginRepositories>
   <dependencyManagement>
     <dependencies>
@@ -366,7 +370,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-pdf-plugin</artifactId>
-        <version>1.2-SNAPSHOT</version>
+        <version>1.2</version>
         <executions>
           <execution>
             <id>pdf</id>
@@ -503,7 +507,7 @@
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-pdf-plugin</artifactId>
-            <version>1.2-SNAPSHOT</version>
+            <version>1.2</version>
             <executions>
               <execution>
                 <id>pdf</id>

Modified: logging/log4j/log4j2/trunk/src/site/resources/pdf-config.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/resources/pdf-config.xml?rev=1407215&r1=1407214&r2=1407215&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/resources/pdf-config.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/resources/pdf-config.xml Thu Nov  8 19:03:14 2012
@@ -24,7 +24,17 @@ under the License.
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:fo="http://www.w3.org/1999/XSL/Format">
-
+  <xsl:attribute-set name="layout.master.set.base">
+    <xsl:attribute name="page-width">8.5in</xsl:attribute>
+    <xsl:attribute name="page-height">11.0in</xsl:attribute>
+    <xsl:attribute name="margin-top">0.625in</xsl:attribute>
+    <xsl:attribute name="margin-bottom">0.6in</xsl:attribute>
+    <xsl:attribute name="margin-left">1in</xsl:attribute>
+    <xsl:attribute name="margin-right">1in</xsl:attribute>
+  </xsl:attribute-set>
+  <xsl:template match="processing-instruction('hard-pagebreak')">
+    <fo:block break-after='page'/>
+  </xsl:template>
   <xsl:attribute-set name="body.pre" use-attribute-sets="base.pre.style">
     <xsl:attribute name="font-size">8pt</xsl:attribute>
   </xsl:attribute-set>

Copied: logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm (from r1406189,
logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml)
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm?p2=logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm&p1=logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml&r1=1406189&r2=1407215&rev=1407215&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/configuration.xml.vm Thu Nov  8 19:03:14
2012
@@ -16,6 +16,8 @@
     limitations under the License.
 -->
 
+#set($dollar = '$')
+
 <document>
     <properties>
         <title>Configuring Log4j 2</title>
@@ -24,6 +26,11 @@
 
     <body>
       <section name="Configuration">
+        #if (!$alignedFileName)
+            #set ($isPDF = true)
+        #else
+            #set ($isPDF = false)
+        #end
         <p>Inserting log requests into the application code requires a fair
           amount of planning and effort. Observation shows that approximately 4
           percent of code is dedicated to logging. Consequently, even moderately
@@ -455,7 +462,7 @@
                      "packages": "org.apache.logging.log4j.test",
       "properties": {
         "property": { "name": "filename",
-                      "value" : "target/rolling1/rollingtest-$${sd:type}.log" }
+                      "value" : "target/rolling1/rollingtest-${dollar}${dollar}{sd:type}.log"
}
       },
     "ThresholdFilter": { "level": "debug" },
     "appenders": {
@@ -466,12 +473,12 @@
         "ThresholdFilter": { "level": "debug" }
       },
       "Routing": { "name": "Routing",
-        "Routes": { "pattern": "$${sd:type}",
+        "Routes": { "pattern": "${dollar}${dollar}{sd:type}",
           "Route": [
             {
               "RollingFile": {
-                "name": "Rolling-${sd:type}", "fileName": "${filename}",
-                "filePattern": "target/rolling1/test1-${sd:type}.%i.log.gz",
+                "name": "Rolling-${dollar}{sd:type}", "fileName": "${dollar}{filename}",
+                "filePattern": "target/rolling1/test1-${dollar}{sd:type}.%i.log.gz",
                 "PatternLayout": {"pattern": "%d %p %C{1.} [%t] %m%n"},
                 "SizeBasedTriggeringPolicy": { "size": "500" }
               }
@@ -501,7 +508,7 @@
                       "packages": "org.apache.logging.log4j.test",
       "properties": {
         "property": { "name": "filename",
-                      "value" : "target/rolling1/rollingtest-$${sd:type}.log" }
+                      "value" : "target/rolling1/rollingtest-${dollar}${dollar}{sd:type}.log"
}
       },
     "ThresholdFilter": { "level": "debug" },
     "appenders": {
@@ -509,12 +516,12 @@
          { "type": "Console", "name": "STDOUT", "PatternLayout": { "pattern": "%m%n" }},
          { "type": "List", "name": "List", "ThresholdFilter": { "level": "debug" }},
          { "type": "Routing",  "name": "Routing",
-          "Routes": { "pattern": "$${sd:type}",
+          "Routes": { "pattern": "${dollar}${dollar}{sd:type}",
             "Route": [
               {
                 "RollingFile": {
-                  "name": "Rolling-${sd:type}", "fileName": "${filename}",
-                  "filePattern": "target/rolling1/test1-${sd:type}.%i.log.gz",
+                  "name": "Rolling-${dollar}{sd:type}", "fileName": "${dollar}{filename}",
+                  "filePattern": "target/rolling1/test1-${dollar}{sd:type}.%i.log.gz",
                   "PatternLayout": {"pattern": "%d %p %C{1.} [%t] %m%n"},
                   "SizeBasedTriggeringPolicy": { "size": "500" }
                 }
@@ -638,7 +645,7 @@
         <MarkerFilter marker="EXCEPTION" onMatch="ACCEPT" onMismatch="DENY"/>
       </filters>
     </Console>
-    <File name="File" fileName="${filename}">
+    <File name="File" fileName="${dollar}{filename}">
       <PatternLayout>
         <pattern>%d %p %C{1.} [%t] %m%n</pattern>
       </PatternLayout>
@@ -656,7 +663,7 @@
     </logger>>
 
     <logger name="org.apache.logging.log4j.test2" level="debug" additivity="false">
-      <property name="user">${sys:user.name}</property>
+      <property name="user">${dollar}{sys:user.name}</property>
       <appender-ref ref="File">
         <ThreadContextMapFilter>
           <KeyValuePair key="test" value="123"/>
@@ -689,7 +696,7 @@
 <configuration status="debug" name="RoutingTest"
                packages="org.apache.logging.log4j.test">
   <properties>
-    <property name="filename">target/rolling1/rollingtest-$${sd:type}.log</property>
+    <property name="filename">target/rolling1/rollingtest-${dollar}${dollar}{sd:type}.log</property>
   </properties>
   <ThresholdFilter level="debug"/>
 
@@ -701,10 +708,10 @@
       <ThresholdFilter level="debug"/>
     </List>
     <Routing name="Routing">
-      <Routes pattern="$${sd:type}">
+      <Routes pattern="${dollar}${dollar}{sd:type}">
         <Route>
-          <RollingFile name="Rolling-${sd:type}" fileName="${filename}"
-                       filePattern="target/rolling1/test1-${sd:type}.%i.log.gz">
+          <RollingFile name="Rolling-${dollar}{sd:type}" fileName="${dollar}{filename}"
+                       filePattern="target/rolling1/test1-${dollar}{sd:type}.%i.log.gz">
             <PatternLayout>
               <pattern>%d %p %C{1.} [%t] %m%n</pattern>
             </PatternLayout>
@@ -730,7 +737,7 @@
 </configuration>]]></source>
           <p>
             While this is useful, there are many more places properties can originate from.
To accommodate this,
-            Log4j also supports the syntax <code>${prefix:name}</code> where
the prefix identifies tells Log4j
+            Log4j also supports the syntax <code>${dollar}{prefix:name}</code>
where the prefix identifies tells Log4j
             that variable name should be evaluated in a specific context. The contexts that
are built in to Logj4
             are:
             <table>
@@ -772,7 +779,7 @@
             In the previous example the "Routes" element is capable of resolving the variable
at runtime. To allow
             this the prefix value is specified as a variable with two leading '$' characters.
When the configuration
             file is first processed the first variable is simply removed. Thus, when the
Routes element is evaluated
-            at runtime it is the variable declaration "${sd:type}" which causes the event
to be inspected for a
+            at runtime it is the variable declaration "${dollar}{sd:type}" which causes the
event to be inspected for a
             StructuredDataMessage and if one is present the value of its type attribute to
be used as the routing key.
             Not all elements support resolving variables at runtime. Components that do will
specifically call that
             out in their documentation.
@@ -822,7 +829,7 @@
 <configuration status="debug" name="RoutingTest"
                packages="org.apache.logging.log4j.test">
   <properties>
-    <property name="filename">target/rolling1/rollingtest-$${sd:type}.log</property>
+    <property name="filename">target/rolling1/rollingtest-${dollar}${dollar}{sd:type}.log</property>
   </properties>
   <ThresholdFilter level="debug"/>
 
@@ -834,10 +841,10 @@
       <ThresholdFilter level="debug"/>
     </List>
     <Routing name="Routing">
-      <Routes pattern="$${sd:type}">
+      <Routes pattern="${dollar}${dollar}{sd:type}">
         <Route>
-          <RollingFile name="Rolling-${sd:type}" fileName="${filename}"
-                       filePattern="target/rolling1/test1-${sd:type}.%i.log.gz">
+          <RollingFile name="Rolling-${dollar}{sd:type}" fileName="${dollar}{filename}"
+                       filePattern="target/rolling1/test1-${dollar}{sd:type}.%i.log.gz">
             <PatternLayout>
               <pattern>%d %p %C{1.} [%t] %m%n</pattern>
             </PatternLayout>
@@ -862,39 +869,119 @@
 
 </configuration>]]></source>
             During startup this configuration produces:
-<source>
-  2011-11-23 17:08:00,769 DEBUG Generated plugins in 0.003374000 seconds
-  2011-11-23 17:08:00,789 DEBUG Calling createProperty on class org.apache.logging.log4j.core.config.Property
for element property with params(name="filename", value="target/rolling1/rollingtest-${sd:type}.log")
-  2011-11-23 17:08:00,792 DEBUG Calling configureSubstitutor on class org.apache.logging.log4j.core.config.plugins.PropertiesPlugin
for element properties with params(properties={filename=target/rolling1/rollingtest-${sd:type}.log})
-  2011-11-23 17:08:00,794 DEBUG Generated plugins in 0.001362000 seconds
-  2011-11-23 17:08:00,797 DEBUG Calling createFilter on class org.apache.logging.log4j.core.filter.ThresholdFilter
for element ThresholdFilter with params(level="debug", onMatch="null", onMismatch="null")
-  2011-11-23 17:08:00,800 DEBUG Calling createLayout on class org.apache.logging.log4j.core.layout.PatternLayout
for element PatternLayout with params(pattern="%m%n", Configuration(RoutingTest), null, charset="null")
-  2011-11-23 17:08:00,802 DEBUG Generated plugins in 0.001349000 seconds
-  2011-11-23 17:08:00,804 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.ConsoleAppender
for element Console with params(PatternLayout(%m%n), null, target="null", name="STDOUT", suppressExceptions="null")
-  2011-11-23 17:08:00,804 DEBUG Calling createFilter on class org.apache.logging.log4j.core.filter.ThresholdFilter
for element ThresholdFilter with params(level="debug", onMatch="null", onMismatch="null")
-  2011-11-23 17:08:00,806 DEBUG Calling createAppender on class org.apache.logging.log4j.test.appender.ListAppender
for element List with params(name="List", entryPerNewLine="null", raw="null", null, ThresholdFilter(DEBUG))
-  2011-11-23 17:08:00,813 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.routing.Route
for element Route with params(appender-ref="null", key="null", Node=Route)
-  2011-11-23 17:08:00,823 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.routing.Route
for element Route with params(appender-ref="STDOUT", key="Audit", Node=Route)
-  2011-11-23 17:08:00,824 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.routing.Route
for element Route with params(appender-ref="List", key="Service", Node=Route)
-  2011-11-23 17:08:00,825 DEBUG Calling createRoutes on class org.apache.logging.log4j.core.appender.routing.Routes
for element Routes with params(pattern="${sd:type}", routes={Route(type=dynamic default),
Route(type=static Reference=STDOUT key='Audit'), Route(type=static Reference=List key='Service')})
-  2011-11-23 17:08:00,827 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.routing.RoutingAppender
for element Routing with params(name="Routing", suppressExceptions="null", Routes({Route(type=dynamic
default),Route(type=static Reference=STDOUT key='Audit'),Route(type=static Reference=List
key='Service')}), Configuration(RoutingTest), null, null)
-  2011-11-23 17:08:00,827 DEBUG Calling createAppenders on class org.apache.logging.log4j.core.config.plugins.AppendersPlugin
for element appenders with params(appenders={STDOUT, List, Routing})
-  2011-11-23 17:08:00,828 DEBUG Calling createAppenderRef on class org.apache.logging.log4j.core.config.plugins.AppenderRefPlugin
for element appender-ref with params(ref="Routing")
-  2011-11-23 17:08:00,829 DEBUG Calling createLogger on class org.apache.logging.log4j.core.config.LoggerConfig
for element logger with params(additivity="false", level="info", name="EventLogger", appender-ref={Routing},
null)
-  2011-11-23 17:08:00,830 DEBUG Calling createAppenderRef on class org.apache.logging.log4j.core.config.plugins.AppenderRefPlugin
for element appender-ref with params(ref="STDOUT")
-  2011-11-23 17:08:00,831 DEBUG Calling createLogger on class org.apache.logging.log4j.core.config.LoggerConfig$RootLogger
for element root with params(additivity="null", level="error", appender-ref={STDOUT}, null)
-  2011-11-23 17:08:00,833 DEBUG Calling createLoggers on class org.apache.logging.log4j.core.config.plugins.LoggersPlugin
for element loggers with params(loggers={EventLogger, root})
-  2011-11-23 17:08:00,834 DEBUG Reconfiguration completed
-  2011-11-23 17:08:00,846 DEBUG Calling createLayout on class org.apache.logging.log4j.core.layout.PatternLayout
for element PatternLayout with params(pattern="%d %p %C{1.} [%t] %m%n", Configuration(RoutingTest),
null, charset="null")
-  2011-11-23 17:08:00,849 DEBUG Calling createPolicy on class org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy
for element SizeBasedTriggeringPolicy with params(size="500")
-  2011-11-23 17:08:00,851 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.RollingFileAppender
for element RollingFile with params(fileName="target/rolling1/rollingtest-Unknown.log", filePattern="target/rolling1/test1-Unknown.%i.log.gz",
append="null", name="Rolling-Unknown", bufferedIO="null", immediateFlush="null", SizeBasedTriggeringPolicy(SizeBasedTriggeringPolicy(size=500)),
null, PatternLayout(%d %p %C{1.} [%t] %m%n), null, suppressExceptions="null")
-  2011-11-23 17:08:00,858 DEBUG Generated plugins in 0.002014000 seconds
-  2011-11-23 17:08:00,889 DEBUG Reconfiguration started for context sun.misc.Launcher$AppClassLoader@37b90b39
-  2011-11-23 17:08:00,890 DEBUG Generated plugins in 0.001355000 seconds
-  2011-11-23 17:08:00,959 DEBUG Generated plugins in 0.001239000 seconds
-  2011-11-23 17:08:00,961 DEBUG Generated plugins in 0.001197000 seconds
-  2011-11-23 17:08:00,965 WARN No Loggers were configured, using default
-  2011-11-23 17:08:00,976 DEBUG Reconfiguration completed</source>
+#if ($isPDF)
+    <source>
+ 2011-11-23 17:08:00,769 DEBUG Generated plugins in 0.003374000 seconds
+ 2011-11-23 17:08:00,789 DEBUG Calling createProperty on class org.apache.logging.log4j.core.
+        config.Property for element property with params(name="filename",
+        value="target/rolling1/rollingtest-${dollar}{sd:type}.log")
+ 2011-11-23 17:08:00,792 DEBUG Calling configureSubstitutor on class org.apache.logging.log4j.
+        core.config.plugins.PropertiesPlugin for element properties with
+        params(properties={filename=target/rolling1/rollingtest-${dollar}{sd:type}.log})
+ 2011-11-23 17:08:00,794 DEBUG Generated plugins in 0.001362000 seconds
+ 2011-11-23 17:08:00,797 DEBUG Calling createFilter on class org.apache.logging.log4j.core.
+        filter.ThresholdFilter for element ThresholdFilter with params(level="debug",
+        onMatch="null", onMismatch="null")
+ 2011-11-23 17:08:00,800 DEBUG Calling createLayout on class org.apache.logging.log4j.core.
+        layout.PatternLayout for element PatternLayout with params(pattern="%m%n",
+        Configuration(RoutingTest), null, charset="null")
+ 2011-11-23 17:08:00,802 DEBUG Generated plugins in 0.001349000 seconds
+ 2011-11-23 17:08:00,804 DEBUG Calling createAppender on class org.apache.logging.log4j.core.
+        appender.ConsoleAppender for element Console with params(PatternLayout(%m%n), null,
+        target="null", name="STDOUT", suppressExceptions="null")
+ 2011-11-23 17:08:00,804 DEBUG Calling createFilter on class org.apache.logging.log4j.core.
+        filter.ThresholdFilter for element ThresholdFilter with params(level="debug",
+        onMatch="null", onMismatch="null")
+ 2011-11-23 17:08:00,806 DEBUG Calling createAppender on class org.apache.logging.log4j.test.
+        appender.ListAppender for element List with params(name="List", entryPerNewLine="null",
+        raw="null", null, ThresholdFilter(DEBUG))
+ 2011-11-23 17:08:00,813 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.
+        routing.Route for element Route with params(appender-ref="null", key="null", Node=Route)
+ 2011-11-23 17:08:00,823 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.
+        routing.Route for element Route with params(appender-ref="STDOUT", key="Audit", Node=Route)
+ 2011-11-23 17:08:00,824 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.
+        routing.Route for element Route with params(appender-ref="List", key="Service", Node=Route)
+ 2011-11-23 17:08:00,825 DEBUG Calling createRoutes on class org.apache.logging.log4j.core.appender.
+        routing.Routes for element Routes with params(pattern="${dollar}{sd:type}",
+        routes={Route(type=dynamic default), Route(type=static Reference=STDOUT key='Audit'),
+        Route(type=static Reference=List key='Service')})
+ 2011-11-23 17:08:00,827 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.
+        routing.RoutingAppender for element Routing with params(name="Routing",
+        suppressExceptions="null", Routes({Route(type=dynamic default),Route(type=static
+        Reference=STDOUT key='Audit'),
+        Route(type=static Reference=List key='Service')}), Configuration(RoutingTest), null,
null)
+ 2011-11-23 17:08:00,827 DEBUG Calling createAppenders on class org.apache.logging.log4j.core.config.
+        plugins.AppendersPlugin for element appenders with params(appenders={STDOUT, List,
Routing})
+ 2011-11-23 17:08:00,828 DEBUG Calling createAppenderRef on class org.apache.logging.log4j.core.
+        config.plugins.AppenderRefPlugin for element appender-ref with params(ref="Routing")
+ 2011-11-23 17:08:00,829 DEBUG Calling createLogger on class org.apache.logging.log4j.core.config.
+        LoggerConfig for element logger with params(additivity="false", level="info", name="EventLogger",
+        appender-ref={Routing}, null)
+ 2011-11-23 17:08:00,830 DEBUG Calling createAppenderRef on class org.apache.logging.log4j.core.
+        config.plugins.AppenderRefPlugin for element appender-ref with params(ref="STDOUT")</source>
+             <source>
+ 2011-11-23 17:08:00,831 DEBUG Calling createLogger on class org.apache.logging.log4j.core.config.
+        LoggerConfig$RootLogger for element root with params(additivity="null", level="error",
+        appender-ref={STDOUT}, null)
+ 2011-11-23 17:08:00,833 DEBUG Calling createLoggers on class org.apache.logging.log4j.core.
+        config.plugins.LoggersPlugin for element loggers with params(loggers={EventLogger,
root})
+ 2011-11-23 17:08:00,834 DEBUG Reconfiguration completed
+ 2011-11-23 17:08:00,846 DEBUG Calling createLayout on class org.apache.logging.log4j.core.
+        layout.PatternLayout for element PatternLayout with params(pattern="%d %p %C{1.}
[%t] %m%n",
+        Configuration(RoutingTest), null, charset="null")
+ 2011-11-23 17:08:00,849 DEBUG Calling createPolicy on class org.apache.logging.log4j.core.
+        appender.rolling.SizeBasedTriggeringPolicy for element SizeBasedTriggeringPolicy
with
+        params(size="500")
+ 2011-11-23 17:08:00,851 DEBUG Calling createAppender on class org.apache.logging.log4j.core.
+        appender.RollingFileAppender for element RollingFile with
+        params(fileName="target/rolling1/rollingtest-Unknown.log",
+        filePattern="target/rolling1/test1-Unknown.%i.log.gz", append="null", name="Rolling-Unknown",
+        bufferedIO="null", immediateFlush="null",
+        SizeBasedTriggeringPolicy(SizeBasedTriggeringPolicy(size=500)), null,
+        PatternLayout(%d %p %C{1.} [%t] %m%n), null, suppressExceptions="null")
+ 2011-11-23 17:08:00,858 DEBUG Generated plugins in 0.002014000 seconds
+ 2011-11-23 17:08:00,889 DEBUG Reconfiguration started for context sun.misc.
+        Launcher$AppClassLoader@37b90b39
+ 2011-11-23 17:08:00,890 DEBUG Generated plugins in 0.001355000 seconds
+ 2011-11-23 17:08:00,959 DEBUG Generated plugins in 0.001239000 seconds
+ 2011-11-23 17:08:00,961 DEBUG Generated plugins in 0.001197000 seconds
+ 2011-11-23 17:08:00,965 WARN No Loggers were configured, using default
+ 2011-11-23 17:08:00,976 DEBUG Reconfiguration completed</source>
+#else
+             <source>
+ 2011-11-23 17:08:00,769 DEBUG Generated plugins in 0.003374000 seconds
+ 2011-11-23 17:08:00,789 DEBUG Calling createProperty on class org.apache.logging.log4j.core.config.Property
for element property with params(name="filename", value="target/rolling1/rollingtest-${dollar}{sd:type}.log")
+ 2011-11-23 17:08:00,792 DEBUG Calling configureSubstitutor on class org.apache.logging.log4j.core.config.plugins.PropertiesPlugin
for element properties with params(properties={filename=target/rolling1/rollingtest-${dollar}{sd:type}.log})
+ 2011-11-23 17:08:00,794 DEBUG Generated plugins in 0.001362000 seconds
+ 2011-11-23 17:08:00,797 DEBUG Calling createFilter on class org.apache.logging.log4j.core.filter.ThresholdFilter
for element ThresholdFilter with params(level="debug", onMatch="null", onMismatch="null")
+ 2011-11-23 17:08:00,800 DEBUG Calling createLayout on class org.apache.logging.log4j.core.layout.PatternLayout
for element PatternLayout with params(pattern="%m%n", Configuration(RoutingTest), null, charset="null")
+ 2011-11-23 17:08:00,802 DEBUG Generated plugins in 0.001349000 seconds
+ 2011-11-23 17:08:00,804 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.ConsoleAppender
for element Console with params(PatternLayout(%m%n), null, target="null", name="STDOUT", suppressExceptions="null")
+ 2011-11-23 17:08:00,804 DEBUG Calling createFilter on class org.apache.logging.log4j.core.filter.ThresholdFilter
for element ThresholdFilter with params(level="debug", onMatch="null", onMismatch="null")
+ 2011-11-23 17:08:00,806 DEBUG Calling createAppender on class org.apache.logging.log4j.test.appender.ListAppender
for element List with params(name="List", entryPerNewLine="null", raw="null", null, ThresholdFilter(DEBUG))
+ 2011-11-23 17:08:00,813 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.routing.Route
for element Route with params(appender-ref="null", key="null", Node=Route)
+ 2011-11-23 17:08:00,823 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.routing.Route
for element Route with params(appender-ref="STDOUT", key="Audit", Node=Route)
+ 2011-11-23 17:08:00,824 DEBUG Calling createRoute on class org.apache.logging.log4j.core.appender.routing.Route
for element Route with params(appender-ref="List", key="Service", Node=Route)
+ 2011-11-23 17:08:00,825 DEBUG Calling createRoutes on class org.apache.logging.log4j.core.appender.routing.Routes
for element Routes with params(pattern="${dollar}{sd:type}", routes={Route(type=dynamic default),
Route(type=static Reference=STDOUT key='Audit'), Route(type=static Reference=List key='Service')})
+ 2011-11-23 17:08:00,827 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.routing.RoutingAppender
for element Routing with params(name="Routing", suppressExceptions="null", Routes({Route(type=dynamic
default),Route(type=static Reference=STDOUT key='Audit'),Route(type=static Reference=List
key='Service')}), Configuration(RoutingTest), null, null)
+ 2011-11-23 17:08:00,827 DEBUG Calling createAppenders on class org.apache.logging.log4j.core.config.plugins.AppendersPlugin
for element appenders with params(appenders={STDOUT, List, Routing})
+ 2011-11-23 17:08:00,828 DEBUG Calling createAppenderRef on class org.apache.logging.log4j.core.config.plugins.AppenderRefPlugin
for element appender-ref with params(ref="Routing")
+ 2011-11-23 17:08:00,829 DEBUG Calling createLogger on class org.apache.logging.log4j.core.config.LoggerConfig
for element logger with params(additivity="false", level="info", name="EventLogger", appender-ref={Routing},
null)
+ 2011-11-23 17:08:00,830 DEBUG Calling createAppenderRef on class org.apache.logging.log4j.core.config.plugins.AppenderRefPlugin
for element appender-ref with params(ref="STDOUT")
+ 2011-11-23 17:08:00,831 DEBUG Calling createLogger on class org.apache.logging.log4j.core.config.LoggerConfig$RootLogger
for element root with params(additivity="null", level="error", appender-ref={STDOUT}, null)
+ 2011-11-23 17:08:00,833 DEBUG Calling createLoggers on class org.apache.logging.log4j.core.config.plugins.LoggersPlugin
for element loggers with params(loggers={EventLogger, root})
+ 2011-11-23 17:08:00,834 DEBUG Reconfiguration completed
+ 2011-11-23 17:08:00,846 DEBUG Calling createLayout on class org.apache.logging.log4j.core.layout.PatternLayout
for element PatternLayout with params(pattern="%d %p %C{1.} [%t] %m%n", Configuration(RoutingTest),
null, charset="null")
+ 2011-11-23 17:08:00,849 DEBUG Calling createPolicy on class org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy
for element SizeBasedTriggeringPolicy with params(size="500")
+ 2011-11-23 17:08:00,851 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.RollingFileAppender
for element RollingFile with params(fileName="target/rolling1/rollingtest-Unknown.log", filePattern="target/rolling1/test1-Unknown.%i.log.gz",
append="null", name="Rolling-Unknown", bufferedIO="null", immediateFlush="null", SizeBasedTriggeringPolicy(SizeBasedTriggeringPolicy(size=500)),
null, PatternLayout(%d %p %C{1.} [%t] %m%n), null, suppressExceptions="null")
+ 2011-11-23 17:08:00,858 DEBUG Generated plugins in 0.002014000 seconds
+ 2011-11-23 17:08:00,889 DEBUG Reconfiguration started for context sun.misc.Launcher$AppClassLoader@37b90b39
+ 2011-11-23 17:08:00,890 DEBUG Generated plugins in 0.001355000 seconds
+ 2011-11-23 17:08:00,959 DEBUG Generated plugins in 0.001239000 seconds
+ 2011-11-23 17:08:00,961 DEBUG Generated plugins in 0.001197000 seconds
+ 2011-11-23 17:08:00,965 WARN No Loggers were configured, using default
+ 2011-11-23 17:08:00,976 DEBUG Reconfiguration completed</source>
+#end
           </p>
           <p>
             If the status attribute is set to error than only error messages will be written
to the console. This

Copied: logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm (from r1406189, logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml)
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm?p2=logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm&p1=logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml&r1=1406189&r2=1407215&rev=1407215&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml (original)
+++ logging/log4j/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm Thu Nov  8 19:03:14 2012
@@ -22,7 +22,14 @@
         <author email="rgoers@apache.org">Ralph Goers</author>
         <author email="ggregory@apache.org">Gary Gregory</author>
     </properties>
-
+  #set($dollar = '$')
+  #if (!$alignedFileName)
+    #set ($isPDF = true)
+    #set ($break = '<br />')
+  #else
+    #set ($isPDF = false)
+    #set ($break = '')
+  #end
     <body>
       <section name="Layouts">
         <p>An Appender uses a Layout to format a LogEvent into a form that meets the
needs of whatever will be
@@ -161,27 +168,27 @@ WARN  [main]: Message 2</pre>
                   </tr>
                   <tr>
                     <td>%c{1}</td>
-                    <td>org.apache.commons.Foo</td>
+                    <td>org.apache.${break}commons.Foo</td>
                     <td>Foo</td>
                   </tr>
                   <tr>
                     <td>%c{2}</td>
-                    <td>org.apache.commons.Foo</td>
+                    <td>org.apache.${break}commons.Foo</td>
                     <td>commons.Foo</td>
                   </tr>
                   <tr>
                     <td>%c{1.}</td>
-                    <td>org.apache.commons.Foo</td>
+                    <td>org.apache.${break}commons.Foo</td>
                     <td>o.a.c.Foo</td>
                   </tr>
                   <tr>
                     <td>%c{1.1.~.~}</td>
-                    <td>org.apache.commons.test.Foo</td>
+                    <td>org.apache.${break}commons.test.${break}Foo</td>
                     <td>o.a.~.~.Foo</td>
                   </tr>
                   <tr>
                     <td>%c{.}</td>
-                    <td>org.apache.commons.test.Foo</td>
+                    <td>org.apache.${break}commons.test.${break}Foo</td>
                     <td>....Foo</td>
                   </tr>
                 </table>
@@ -372,18 +379,38 @@ WARN  [main]: Message 2</pre>
                  <pre>%highlight{%d [%t] %-5level: %msg%n%throwable}</pre>
                 </p>
                 <p>You can override the default colors in the optional {style} option.
For example:
+ #if ($isPDF)
+                 <pre>%highlight{%d [%t] %-5level: %msg%n%throwable}
+   {FATAL=white, ERROR=red, WARN=blue, INFO=black,
+    DEBUG=green, TRACE=blue}</pre>
+ #else
                  <pre>%highlight{%d [%t] %-5level: %msg%n%throwable}{FATAL=white, ERROR=red,
WARN=blue, INFO=black, DEBUG=green, TRACE=blue}</pre>
+ #end
                 </p>
                 <p>You can highlight only the a portion of the log event:
                  <pre>%d [%t] %highlight{%-5level: %msg%n%throwable}</pre>
                 </p>
                 <p>You can style one part of the message and highlight the rest the
log event:
+ #if ($isPDF)
+                 <pre>%style{%d [%t]}{black} %highlight{%-5level:
+                     %msg%n%throwable}</pre>
+ #else
                  <pre>%style{%d [%t]}{black} %highlight{%-5level: %msg%n%throwable}</pre>
+ #end
                 </p>
+                  #if ($isPDF)
+                      <!--PB-->
+                  #end
                 <p>You can also use the STYLE key to use a predefined group of colors:
+ #if ($isPDF)
+                 <pre>%highlight{%d [%t] %-5level: %msg%n%throwable}
+   {STYLE=Logback}</pre>
+ #else
                  <pre>%highlight{%d [%t] %-5level: %msg%n%throwable}{STYLE=Logback}</pre>
+ #end
                  The STYLE value can be one of:
                  <table border="1" width="100%">
+                   <?dbfo keep-together="auto" ?>
                    <tr>
                      <th>Style</th>
                      <th>Description</th>
@@ -882,17 +909,30 @@ WARN  [main]: Message 2</pre>
   <property name="filters">org.junit,org.apache.maven,sun.reflect,java.lang.reflect</property>
 </properties>
 ...
-<PatternLayout pattern="%m%xEx{filters(${filters})}%n"/>]]></source>
+<PatternLayout pattern="%m%xEx{filters(${dollar}{filters})}%n"/>]]></source>
           <p>The result printed to the console will appear similar to:
           </p>
+ #if ($isPDF)
+          <source>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>
+ #else
           <source>Exception java.lang.IllegalArgumentException: IllegalArgument
 at org.apache.logging.log4j.core.pattern.ExtendedThrowableTest.testException(ExtendedThrowableTest.java:72)
[test-classes/:?]
 ... suppressed 26 lines
-at $Proxy0.invoke(Unknown Source) [?:?]
+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>
+ #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>



Mime
View raw message