You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2017/07/04 17:23:59 UTC
logging-log4j2 git commit: [LOG4J2-1966] Include separator option of
PatternLayout in manual (and other updates).
Repository: logging-log4j2
Updated Branches:
refs/heads/master 02f9767c9 -> 7fdca4ff1
[LOG4J2-1966] Include separator option of PatternLayout in manual (and
other updates).
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/7fdca4ff
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/7fdca4ff
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/7fdca4ff
Branch: refs/heads/master
Commit: 7fdca4ff159a4923949b45c33fd4601926be5ffc
Parents: 02f9767
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Jul 4 10:23:56 2017 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Jul 4 10:23:56 2017 -0700
----------------------------------------------------------------------
src/changes/changes.xml | 3 +
src/site/xdoc/manual/layouts.xml.vm | 143 +++++++++++++++++++------------
2 files changed, 93 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7fdca4ff/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8ff575c..c99d604 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -112,6 +112,9 @@
<action issue="LOG4J2-1917" dev="rgoers" type="update">
Support using java.util.ServiceLoader to locate Log4j 2 API providers.
</action>
+ <action issue="LOG4J2-1966" dev="ggregory" type="update" due-to="M Sazzadul Hoque">
+ Include separator option of PatternLayout in manual (and other updates).
+ </action>
<action issue="LOG4J2-1854" dev="mikes" type="add" due-to="Xavier Jodoin">
Support null byte delimiter in GelfLayout.
</action>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7fdca4ff/src/site/xdoc/manual/layouts.xml.vm
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/layouts.xml.vm b/src/site/xdoc/manual/layouts.xml.vm
index a8353bd..6325c01 100644
--- a/src/site/xdoc/manual/layouts.xml.vm
+++ b/src/site/xdoc/manual/layouts.xml.vm
@@ -838,60 +838,71 @@ WARN [main]: Message 2</pre>
</tr>
<tr>
<td align="center">
- <b>ex</b>|<b>exception</b>|<b>throwable</b><br />
- {["none"<br />
- |"full"<br />
- |depth<br />
- |"short"<br />
- |"short.className"<br />
- |"short.fileName"<br />
- |"short.lineNumber"<br />
- |"short.methodName"<br />
- |"short.message"<br />
- |"short.localizedMessage"]}<br />
- {suffix(<i>pattern</i>)}
- <!-- TODO: there are actually more options available in ThrowableFormatOptions that apply here -->
- <!-- separator(), filters(), and ansi() -->
+ <b>ex</b>|<b>exception</b>|<b>throwable</b><br/>
+ {<br/>
+ [ "none"<br />
+ | "full"<br />
+ | depth<br />
+ | "short"<br />
+ | "short.className"<br />
+ | "short.fileName"<br />
+ | "short.lineNumber"<br />
+ | "short.methodName"<br />
+ | "short.message"<br />
+ | "short.localizedMessage"]}<br />
+ [,filters(package,package,...)]<br/>
+ [,separator(<i>separator</i>)]<br/>
+ }<br/>
+ {suffix(<i>pattern</i>)<br/>
+ }<br/>
</td>
<td>
<p>
- Outputs the Throwable trace bound to the LoggingEvent, by default this will output the full trace
- as one would normally find with a call to Throwable.printStackTrace().
+ Outputs the Throwable trace bound to the logging event, by default this will output the full trace
+ as one would normally find with a call to <code>Throwable.printStackTrace()</code>.
</p>
<p>
- You can follow the throwable conversion word with an option in the form <b>%throwable{option}</b>.
+ You can follow the throwable conversion word with an option in the form <code>%throwable{option}</code>.
</p>
<p>
- <b>%throwable{short}</b> outputs the first line of the Throwable.
+ <code>%throwable{short}</code> outputs the first line of the Throwable.
</p>
<p>
- <b>%throwable{short.className}</b> outputs the name of the class where the exception occurred.
+ <code>%throwable{short.className}</code> outputs the name of the class where the exception occurred.
</p>
<p>
- <b>%throwable{short.methodName}</b> outputs the method name where the exception occurred.
+ <code>%throwable{short.methodName}</code> outputs the method name where the exception occurred.
</p>
<p>
- <b>%throwable{short.fileName}</b> outputs the name of the class where the exception occurred.
+ <code>%throwable{short.fileName}</code> outputs the name of the class where the exception occurred.
</p>
<p>
- <b>%throwable{short.lineNumber}</b> outputs the line number where the exception occurred.
+ <code>%throwable{short.lineNumber}</code> outputs the line number where the exception occurred.
</p>
<p>
- <b>%throwable{short.message}</b> outputs the message.
+ <code>%throwable{short.message}</code> outputs the message.
</p>
<p>
- <b>%throwable{short.localizedMessage}</b> outputs the localized message.
+ <code>%throwable{short.localizedMessage}</code> outputs the localized message.
</p>
<p>
- <b>%throwable{n}</b> outputs the first n lines of the stack trace.
+ <code>%throwable{n}</code> outputs the first n lines of the stack trace.
</p>
<p>
- Specifying <b>%throwable{none}</b> or <b>%throwable{0}</b> suppresses output of the exception.
+ Specifying <code>%throwable{none}</code> or <code>%throwable{0}</code> suppresses output of the exception.
+ </p>
+ <p>
+ Use <code>filters(<i>packages</i>)</code> where <i>packages</i> is a list of package names to
+ suppress matching stack frames from stack traces.
+ </p>
+ <p>
+ Use a <code>separator</code> string to separate the lines of a stack trace. For example:
+ <code>separator(|)</code>. The default value is the <code>line.separator</code> system property,
+ which is operating system dependent.
</p>
<p>
- Specifying <b>%throwable{suffix{<i>pattern</i>}</b> adds the output of <i>pattern</i> to the
- output only if there is a throwable to print. This option is orthogonal with the above
- conversions.
+ Use <code>ex{suffix(<i>pattern</i>)</code> to add the output of <i>pattern</i> to the output only
+ when there is a throwable to print.
</p>
</td>
</tr>
@@ -1327,27 +1338,44 @@ WARN [main]: Message 2</pre>
<tr>
<td align="center">
<a name="PatternException"/>
- <b>rEx</b>{["none"|"short"|"full"|depth]}{[filters(packages)]}{suffix(<i>pattern</i>)}<br />
- <b>rException</b>{["none"|"short"|"full"|depth]}{[filters(packages)]}{suffix(<i>pattern</i>)}<br />
- <b>rThrowable</b>{["none"|"short"|"full"|depth]}{[filters(packages)]}{suffix(<i>pattern</i>)}
- <!-- TODO: more options are available in ThrowableFormatOptions -->
- <!-- FIXME: these options are confusing! -->
+ <b>rEx</b>|<b>rException</b>|<b>rThrowable</b><br/>
+ {<br/>
+ ["none" | "short" | "full" | depth]<br/>
+ [,filters(package,package,...)]<br/>
+ [,separator(<i>separator</i>)]<br/>
+ }<br/>
+ {ansi(<br/>
+ Key=Value,Value,...<br/>
+ Key=Value,Value,...<br/>
+ ...)<br/>
+ }<br/>
+ {suffix(<i>pattern</i>)}<br/>
</td>
<td>
- <p>The same as the %throwable conversion word but the stack trace is printed starting with the
+ <p>
+ The same as the %throwable conversion word but the stack trace is printed starting with the
first exception that was thrown followed by each subsequent wrapping exception.
</p>
- <p>The throwable conversion word can be followed by an option in the form
- <b>%rEx{short}</b>
- which will only output the first line of the Throwable or <b>%rEx{n}</b> where
- the first n lines of the stacktrace will be printed. The conversion word can also be
- followed by "filters(packages)" where packages is a list of package names that should
- be suppressed from stack traces. Specifying <b>%rEx{none}</b>
- or <b>%rEx{0}</b> will suppress printing of the exception.
+ <p>
+ The throwable conversion word can be followed by an option in the form
+ <code>%rEx{short}</code> which will only output the first line of the Throwable or
+ <code>%rEx{n}</code> where the first n lines of the stack trace will be printed.
+ </p>
+ <p>
+ Specifying <code>%rEx{none}</code> or <code>%rEx{0}</code> will suppress printing of the exception.
+ </p>
+ <p>
+ Use <code>filters(<i>packages</i>)</code> where <i>packages</i> is a list of package names to
+ suppress matching stack frames from stack traces.
</p>
<p>
- As with the %throwable conversion, using <b>rEx{suffix(<i>pattern</i>)</b> will add the output
- of <i>pattern</i> to the output only if there is a throwable to print.
+ Use a <code>separator</code> string to separate the lines of a stack trace. For example:
+ <code>separator(|)</code>. The default value is the <code>line.separator</code> system property,
+ which is operating system dependent.
+ </p>
+ <p>
+ Use <code>rEx{suffix(<i>pattern</i>)</code> to add the output of <i>pattern</i> to the output only
+ when there is a throwable to print.
</p>
</td>
</tr>
@@ -1570,8 +1598,9 @@ WARN [main]: Message 2</pre>
<a name="PatternExtendedException"/>
<b>xEx</b>|<b>xException</b>|<b>xThrowable</b><br/>
{<br/>
- ["none"|"short"|"full"|depth]<br/>
+ ["none" | "short" | "full" | depth]<br/>
[,filters(package,package,...)]<br/>
+ [,separator(<i>separator</i>)]<br/>
}<br/>
{ansi(<br/>
Key=Value,Value,...<br/>
@@ -1583,18 +1612,26 @@ WARN [main]: Message 2</pre>
<td>
<p>The same as the %throwable conversion word but also includes class packaging information.
</p>
- <p>At the end of each stack element of the exception, a string containing the name of the jar file
+ <p>
+ At the end of each stack element of the exception, a string containing the name of the jar file
that contains the class or the directory the class is located in and the "Implementation-Version"
as found in that jar's manifest will be added. If the information is uncertain, then the class
packaging data will be preceded by a tilde, i.e. the '~' character.
</p>
<p>The throwable conversion word can be followed by an option in the form
- <b>%xEx{short}</b>
- which will only output the first line of the Throwable or <b>%xEx{n}</b> where
- the first n lines of the stacktrace will be printed. The conversion word can also be
- followed by "filters(packages)" where packages is a comma-sepaarted list of package names that
- should be suppressed from stack traces. Specifying <b>%xEx{none}</b>
- or <b>%xEx{0}</b> will suppress printing of the exception.
+ <code>%xEx{short}</code>
+ which will only output the first line of the Throwable or <code>%xEx{n}</code> where
+ the first n lines of the stack trace will be printed. Specifying <code>%xEx{none}</code>
+ or <code>%xEx{0}</code> will suppress printing of the exception.
+ </p>
+ <p>
+ Use <code>filters(<i>packages</i>)</code> where <i>packages</i> is a list of package names to
+ suppress matching stack frames from stack traces.
+ </p>
+ <p>
+ Use a <code>separator</code> string to separate the lines of a stack trace. For example:
+ <code>separator(|)</code>. The default value is the <code>line.separator</code> system property,
+ which is operating system dependent.
</p>
<p>
The <code>ansi</code> option renders stack traces with ANSI escapes code using the JAnsi library.
@@ -1632,7 +1669,7 @@ WARN [main]: Message 2</pre>
class like <code>blue</code>, <code>bg_red</code>, and so on (Log4j ignores case.)
</p>
<p>
- The special key <code>StyleMapName</code> can be set to one of the following prefedined maps:
+ The special key <code>StyleMapName</code> can be set to one of the following predefined maps:
<code>Spock</code>, <code>Kirk</code>.
</p>
<p>