[
https://issues.apache.org/jira/browse/LOG4J2-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14522877#comment-14522877
]
Gary Gregory commented on LOG4J2-1003:
--------------------------------------
This is my proposed patch:
{noformat}
diff --git
a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/WrappedLogger.java
b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/WrappedLogger.java
index 3093ecb..8e54185 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/WrappedLogger.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/WrappedLogger.java
@@ -72,6 +72,6 @@
@Override
public <T extends Throwable> T throwing(final T t) {
- return throwing(FQCN, Level.ERROR, t);
+ return throwing(FQCN,
LevelTranslator.toLevel(java.util.logging.Level.FINER), t);
}
}
{noformat}
> Logger.throwing is mis-mapped to ERROR when it should be TRACE
> --------------------------------------------------------------
>
> Key: LOG4J2-1003
> URL: https://issues.apache.org/jira/browse/LOG4J2-1003
> Project: Log4j 2
> Issue Type: Bug
> Components: JUL adapter
> Affects Versions: 2.2
> Reporter: Dan Armbrust
> Labels: easyfix
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> The Java Logger has a method named throwing -
> https://docs.oracle.com/javase/7/docs/api/java/util/logging/Logger.html#throwing%28java.lang.String,%20java.lang.String,%20java.lang.Throwable%29
> Which, strangely, logs at the FINER level.
> According to the documentation, this should be mapped to TRACE:
> https://logging.apache.org/log4j/2.0/log4j-jul/index.html
> However, in org.apache.logging.log4j.jul.WrappedLogger - it has been mapped
> to Level.ERROR
> https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=blob;f=log4j-jul/src/main/java/org/apache/logging/log4j/jul/WrappedLogger.java;h=3093ecb546c57678c140deb27029646961df6946;hb=d04659cde3f58521cb8c114ab5032b19a4644cc5#l75
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]