Repository: logging-log4j2 Updated Branches: refs/heads/master 185ff18ad -> 4ff1b03fa
LOG4J2-771 (Main Args Lookup) minor text fixes and clarifications; added usage example Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/4ff1b03f Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/4ff1b03f Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/4ff1b03f Branch: refs/heads/master Commit: 4ff1b03fab80ef613a36783b3f1a79c8c02a53c6 Parents: 185ff18 Author: rpopma <[email protected]> Authored: Sun Sep 28 00:27:40 2014 +0900 Committer: rpopma <[email protected]> Committed: Sun Sep 28 00:27:40 2014 +0900 ---------------------------------------------------------------------- src/site/xdoc/manual/lookups.xml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4ff1b03f/src/site/xdoc/manual/lookups.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/manual/lookups.xml b/src/site/xdoc/manual/lookups.xml index df7b275..0140199 100644 --- a/src/site/xdoc/manual/lookups.xml +++ b/src/site/xdoc/manual/lookups.xml @@ -37,6 +37,7 @@ <a name="AppMainArgsLookup"/> <subsection name="Application main arguments lookup"> <p> + This lookup requires a manual step. You can access the main arguments of an application if they have been set with: </p> <pre class="prettyprint linenums"><![CDATA[ @@ -52,9 +53,10 @@ public static void main(String args[]) { </p> <pre>--file foo.txt --verbose -x bar</pre> <p> - I can use the following substitutions with the <code>main</code> prefix with a 0-based index or a string: + You can use the following substitutions with the <code>main</code> prefix with a 0-based index or a string. + Using <code>${main:string}</code> gives you the next value in the argument list after the given <code>string</code>. </p> - <table> + <table style="width: 40%"> <tr> <th>Expression</th> <th>Result</th> @@ -107,10 +109,16 @@ public static void main(String args[]) { <p><code>null</code></p> </td> </tr> - </table> - <p> - Using <code>${main:string}</code> gives you the next value in the argument list after the given string. - </p> + </table> + <p> + Example usage: + </p> + <pre class="prettyprint linenums"><![CDATA[ +<File name="Application" fileName="application.log"> + <PatternLayout header="File: ${main:--file}"> + <Pattern>%d %m%n</Pattern> + </PatternLayout> +</File>]]></pre> </subsection> <a name="ContextMapLookup"/> <subsection name="Context Map Lookup">
