You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/10/05 04:37:07 UTC
[3/6] git commit: Use Log4jReleaseVersion variable.
Use Log4jReleaseVersion variable.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6efeeed3
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6efeeed3
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6efeeed3
Branch: refs/heads/master
Commit: 6efeeed3dc19ccaae0491c368350ab32fc2251ec
Parents: 13abc79
Author: Matt Sicker <ma...@apache.org>
Authored: Sat Oct 4 20:55:37 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Sat Oct 4 20:55:37 2014 -0500
----------------------------------------------------------------------
src/site/xdoc/manual/customloglevels.xml.vm | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6efeeed3/src/site/xdoc/manual/customloglevels.xml.vm
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/customloglevels.xml.vm b/src/site/xdoc/manual/customloglevels.xml.vm
index 09c1121..a08ca3e 100644
--- a/src/site/xdoc/manual/customloglevels.xml.vm
+++ b/src/site/xdoc/manual/customloglevels.xml.vm
@@ -15,6 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+#set($dollar = '$')
<document xmlns="http://maven.apache.org/XDOC/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -145,7 +146,7 @@ logger.log(Level.getLevel("FORGOT_TO_DEFINE"), "some message"); // throws except
<CustomLevel name="NOTICE" intLevel="450" />
<CustomLevel name="VERBOSE" intLevel="550" />
</CustomLevels>
-
+
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-7level %logger{36} - %msg%n"/>
@@ -218,7 +219,7 @@ logger.diag("another message");</pre>
</p>
<p>
For example, for medical devices we could have only <tt>critical()</tt>, <tt>warning()</tt>,
- and <tt>advisory()</tt> methods.
+ and <tt>advisory()</tt> methods.
Another example could be a game that has only <tt>defcon1()</tt>, <tt>defcon2()</tt>,
and <tt>defcon3()</tt> levels.
</p>
@@ -273,7 +274,7 @@ import com.mycompany.myproject.ExtLogger;
public class MyService {
// instead of Logger logger = LogManager.getLogger(MyService.class):
private static final ExtLogger logger = ExtLogger.create(MyService.class);
-
+
public void someMethod() {
// ...
logger.trace("the built-in TRACE level");
@@ -296,7 +297,7 @@ public class MyService {
Use the following command to generate a logger wrapper that adds methods to the built-in ones:
</p>
<pre class="prettyprint">
-java -cp log4j-core-${project.version}.jar org.apache.logging.log4j.core.tools.Generate$ExtendedLogger \
+java -cp log4j-core-${Log4jReleaseVersion}.jar org.apache.logging.log4j.core.tools.Generate${dollar}ExtendedLogger} \
com.mycomp.ExtLogger DIAG=350 NOTICE=450 VERBOSE=550 > com/mycomp/ExtLogger.java</pre>
<p>
This will generate source code for a logger wrapper that has the convenience methods
@@ -310,7 +311,7 @@ java -cp log4j-core-${project.version}.jar org.apache.logging.log4j.core.tools.G
Use the following command to generate a logger wrapper that hides the built-in levels and has only custom levels:
</p>
<pre class="prettyprint">
-java -cp log4j-core-${project.version}.jar org.apache.logging.log4j.core.tools.Generate$CustomLogger \
+java -cp log4j-core-${Log4jReleaseVersion}.jar org.apache.logging.log4j.core.tools.Generate${dollar}CustomLogger \
com.mycomp.MyLogger DEFCON1=350 DEFCON2=450 DEFCON3=550 > com/mycomp/MyLogger.java</pre>
<p>
This will generate source code for a logger wrapper that <em>only</em> has convenience