Discussion:
[1/4] git commit: Update JUL bridge docs.
Remko Popma
2014-09-18 23:50:05 UTC
Permalink
Thanks!

I just realized that if a JUL custom level is used without specifying a LevelConverter, it's actually not a problem: the Logger's level will be null and it will just use the log level of its parent (that's a fairly recent change, I think)!

Is it worth mentioning that in the docs?

Sent from my iPhone
Repository: logging-log4j2
refs/heads/master b1783a0aa -> c8406750d
Update JUL bridge docs.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2a06bf1b
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2a06bf1b
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2a06bf1b
Branch: refs/heads/master
Commit: 2a06bf1b4f6456f3322d923e2e36e38e15a20f12
Parents: b1783a0
Authored: Thu Sep 18 17:33:29 2014 -0500
Committed: Thu Sep 18 17:33:29 2014 -0500
----------------------------------------------------------------------
log4j-jul/src/site/xdoc/index.xml | 65 ++++++----------------------------
1 file changed, 10 insertions(+), 55 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2a06bf1b/log4j-jul/src/site/xdoc/index.xml
----------------------------------------------------------------------
diff --git a/log4j-jul/src/site/xdoc/index.xml b/log4j-jul/src/site/xdoc/index.xml
index 5429092..216dceb 100644
--- a/log4j-jul/src/site/xdoc/index.xml
+++ b/log4j-jul/src/site/xdoc/index.xml
@@ -34,7 +34,7 @@
</section>
<section name="Requirements">
<p>
- The JDK Logging Adaptor requires at least Java 6 and is dependent on the Log4j API and Log4j Core.
+ The JDK Logging Adaptor requires at least Java 6 and is dependent on the Log4j API and optionally Log4j Core.
</p>
</section>
<section name="Usage">
@@ -66,103 +66,58 @@
</p>
<p>
Java logging levels are translated into Log4j logging levels dynamically. The following table lists the
- conversions between a Java logging level and its equivalent Log4j level.
+ conversions between a Java logging level and its equivalent Log4j level. Custom levels should be implemented
+ as an implementation of
+ <a class="javadoc" href="apidocs/org/apache/logging/log4j/jul/LevelConverter.html">LevelConverter</a>, and the
+ Log4j property <kbd>log4j.jul.levelConverter</kbd> must be set to your custom class name.
</p>
<table>
- <caption>Level conversions</caption>
+ <caption>Default Level conversions</caption>
<thead>
<tr>
<th>Java Level</th>
- <th>Level Range</th>
<th>Log4j Level</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#OFF">OFF</a></td>
- <td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MAX_VALUE">Integer.MAX_VALUE</a></td>
<td>OFF</td>
</tr>
<tr>
- <td class="muted">n/a</td>
- <td>1000 &lt; <var>level</var> &lt; <a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MAX_VALUE">Integer.MAX_VALUE</a></td>
- <td>FATAL</td>
- </tr>
- <tr>
<td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#SEVERE">SEVERE</a></td>
- <td>900 &lt; <var>level</var> &le; 1000</td>
<td>ERROR</td>
</tr>
<tr>
<td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#WARNING">WARNING</a></td>
- <td>800 &lt; <var>level</var> &le; 900</td>
<td>WARN</td>
</tr>
<tr>
<td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#INFO">INFO</a></td>
- <td>700 &lt; <var>level</var> &le; 800</td>
<td>INFO</td>
</tr>
<tr>
<td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#CONFIG">CONFIG</a></td>
- <td>500 &lt; <var>level</var> &le; 700</td>
- <td>INFO</td>
+ <td><a class="javadoc" href="apidocs/org/apache/logging/log4j/jul/LevelTranslator.html#CONFIG">CONFIG</a></td>
</tr>
<tr>
<td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINE">FINE</a></td>
- <td>400 &lt; <var>level</var> &le; 500</td>
<td>DEBUG</td>
</tr>
<tr>
<td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINER">FINER</a></td>
- <td>300 &lt; <var>level</var> &le; 400</td>
- <td>DEBUG</td>
+ <td>TRACE</td>
</tr>
<tr>
<td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINEST">FINEST</a></td>
- <td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MIN_VALUE">Integer.MIN_VALUE</a> &lt; <var>level</var> &le; 300</td>
- <td>TRACE</td>
+ <td><a class="javadoc" href="apidocs/org/apache/logging/log4j/jul/LevelTranslator.html#FINEST">FINEST</a></td>
</tr>
<tr>
<td>ALL</td>
- <td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MIN_VALUE">Integer.MIN_VALUE</a></td>
<td>ALL</td>
</tr>
</tbody>
</table>
- <p>
- There are currently three additional pieces of information obtained from each
- <a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html">LogRecord</a>
- that are stored in the <a href="../manual/thread-context.html">ThreadContext</a>.
- </p>
- <table>
- <caption>ThreadContext map keys</caption>
- <thead>
- <tr>
- <th>Key</th>
- <th><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html">LogRecord</a> Property</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>log4j.jul.threadID</td>
- <td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html#getThreadID%28%29">threadID</a></td>
- <td>An identifier for the thread where the message originated.</td>
- </tr>
- <tr>
- <td>log4j.jul.sequenceNumber</td>
- <td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html#getSequenceNumber%28%29">sequenceNumber</a></td>
- <td>A unique, increasing sequence number generated by the LogRecord constructor.</td>
- </tr>
- <tr>
- <td>log4j.jul.level</td>
- <td><a class="javadoc" href="http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html#getLevel%28%29">level</a></td>
- <td>The logging message level name. This level is translated into an equivalent Log4j level, so the original
- logging level name is saved here.</td>
- </tr>
- </tbody>
- </table>
</section>
</body>
-</document>
\ No newline at end of file
+</document>
Matt Sicker
2014-09-19 00:01:15 UTC
Permalink
Good catch. I'll push an update in a sec.
Post by Remko Popma
Thanks!
I just realized that if a JUL custom level is used without specifying a
LevelConverter, it's actually not a problem: the Logger's level will be
null and it will just use the log level of its parent (that's a fairly
recent change, I think)!
Is it worth mentioning that in the docs?
Sent from my iPhone
Repository: logging-log4j2
refs/heads/master b1783a0aa -> c8406750d
Update JUL bridge docs.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2a06bf1b
http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2a06bf1b
http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2a06bf1b
Branch: refs/heads/master
Commit: 2a06bf1b4f6456f3322d923e2e36e38e15a20f12
Parents: b1783a0
Authored: Thu Sep 18 17:33:29 2014 -0500
Committed: Thu Sep 18 17:33:29 2014 -0500
----------------------------------------------------------------------
log4j-jul/src/site/xdoc/index.xml | 65 ++++++----------------------------
1 file changed, 10 insertions(+), 55 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2a06bf1b/log4j-jul/src/site/xdoc/index.xml
----------------------------------------------------------------------
diff --git a/log4j-jul/src/site/xdoc/index.xml
b/log4j-jul/src/site/xdoc/index.xml
index 5429092..216dceb 100644
--- a/log4j-jul/src/site/xdoc/index.xml
+++ b/log4j-jul/src/site/xdoc/index.xml
@@ -34,7 +34,7 @@
</section>
<section name="Requirements">
<p>
- The JDK Logging Adaptor requires at least Java 6 and is
dependent on the Log4j API and Log4j Core.
+ The JDK Logging Adaptor requires at least Java 6 and is
dependent on the Log4j API and optionally Log4j Core.
</p>
</section>
<section name="Usage">
@@ -66,103 +66,58 @@
</p>
<p>
Java logging levels are translated into Log4j logging levels
dynamically. The following table lists the
- conversions between a Java logging level and its equivalent
Log4j level.
+ conversions between a Java logging level and its equivalent
Log4j level. Custom levels should be implemented
+ as an implementation of
+ <a class="javadoc"
href="apidocs/org/apache/logging/log4j/jul/LevelConverter.html">LevelConverter</a>,
and the
+ Log4j property <kbd>log4j.jul.levelConverter</kbd> must be set
to your custom class name.
</p>
<table>
- <caption>Level conversions</caption>
+ <caption>Default Level conversions</caption>
<thead>
<tr>
<th>Java Level</th>
- <th>Level Range</th>
<th>Log4j Level</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#OFF
">OFF</a></td>
- <td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MAX_VALUE
">Integer.MAX_VALUE</a></td>
<td>OFF</td>
</tr>
<tr>
- <td class="muted">n/a</td>
- <td>1000 &lt; <var>level</var> &lt; <a class="javadoc"
href="
http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MAX_VALUE
">Integer.MAX_VALUE</a></td>
- <td>FATAL</td>
- </tr>
- <tr>
<td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#SEVERE
">SEVERE</a></td>
- <td>900 &lt; <var>level</var> &le; 1000</td>
<td>ERROR</td>
</tr>
<tr>
<td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#WARNING
">WARNING</a></td>
- <td>800 &lt; <var>level</var> &le; 900</td>
<td>WARN</td>
</tr>
<tr>
<td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#INFO
">INFO</a></td>
- <td>700 &lt; <var>level</var> &le; 800</td>
<td>INFO</td>
</tr>
<tr>
<td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#CONFIG
">CONFIG</a></td>
- <td>500 &lt; <var>level</var> &le; 700</td>
- <td>INFO</td>
+ <td><a class="javadoc"
href="apidocs/org/apache/logging/log4j/jul/LevelTranslator.html#CONFIG">CONFIG</a></td>
</tr>
<tr>
<td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINE
">FINE</a></td>
- <td>400 &lt; <var>level</var> &le; 500</td>
<td>DEBUG</td>
</tr>
<tr>
<td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINER
">FINER</a></td>
- <td>300 &lt; <var>level</var> &le; 400</td>
- <td>DEBUG</td>
+ <td>TRACE</td>
</tr>
<tr>
<td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/Level.html#FINEST
">FINEST</a></td>
- <td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MIN_VALUE">Integer.MIN_VALUE</a>
&lt; <var>level</var> &le; 300</td>
- <td>TRACE</td>
+ <td><a class="javadoc"
href="apidocs/org/apache/logging/log4j/jul/LevelTranslator.html#FINEST">FINEST</a></td>
</tr>
<tr>
<td>ALL</td>
- <td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/lang/Integer.html#MIN_VALUE
">Integer.MIN_VALUE</a></td>
<td>ALL</td>
</tr>
</tbody>
</table>
- <p>
- There are currently three additional pieces of information
obtained from each
- <a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html
">LogRecord</a>
- that are stored in the <a
href="../manual/thread-context.html">ThreadContext</a>.
- </p>
- <table>
- <caption>ThreadContext map keys</caption>
- <thead>
- <tr>
- <th>Key</th>
- <th><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html">LogRecord</a>
Property</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>log4j.jul.threadID</td>
- <td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html#getThreadID%28%29
">threadID</a></td>
- <td>An identifier for the thread where the message
originated.</td>
- </tr>
- <tr>
- <td>log4j.jul.sequenceNumber</td>
- <td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html#getSequenceNumber%28%29
">sequenceNumber</a></td>
- <td>A unique, increasing sequence number generated by the
LogRecord constructor.</td>
- </tr>
- <tr>
- <td>log4j.jul.level</td>
- <td><a class="javadoc" href="
http://docs.oracle.com/javase/6/docs/api/java/util/logging/LogRecord.html#getLevel%28%29
">level</a></td>
- <td>The logging message level name. This level is
translated into an equivalent Log4j level, so the original
- logging level name is saved here.</td>
- </tr>
- </tbody>
- </table>
</section>
</body>
-</document>
\ No newline at end of file
+</document>
---------------------------------------------------------------------
--
Matt Sicker <***@gmail.com>
Loading...