[
https://issues.apache.org/jira/browse/LOG4J2-3021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17285817#comment-17285817
]
ASF subversion and git services commented on LOG4J2-3021:
---------------------------------------------------------
Commit 7ba81651ce3313c6e31f19f22b1b79b28bdcc451 in logging-log4j2's branch
refs/heads/LOG4J2-3020 from Volkan Yazici
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=7ba8165 ]
LOG4J2-3020 LOG4J2-3021 Incorporate requested changes.
> Logger.throwing(Throwable) does not document level it is logging at
> -------------------------------------------------------------------
>
> Key: LOG4J2-3021
> URL: https://issues.apache.org/jira/browse/LOG4J2-3021
> Project: Log4j 2
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 2.14.0
> Reporter: Marcono1234
> Assignee: Volkan Yazici
> Priority: Major
>
> The
> [documentation|https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Logger.html#throwing-T-]
> of the method {{Logger.throwing(Throwable)}} is not mentioning at which
> level it is logging at.
> It appears {{AbstractLogger}} is logging at level {{ERROR}}, but without it
> being explicitly mentioned, I think expecting it to be logged at {{DEBUG}}
> might also be a reasonable expectation.
> In fact LOG4J2-1003 implements it to log at debug level, and based on what
> the {{throwing}} documentation suggests as use case, {{AbstractLogger}}
> should be logging at debug level:
> {quote}
> {code}
> throw logger.throwing(myException);
> {code}
> {quote}
> Having an exception which is thrown additionally be logged as error will
> result in duplicate error messages in the log file (unless the exception
> handling is broken), one from the {{throwing}} call and a second one from the
> method handling that exception.
> Therefore {{throwing}} should in my opinion only log at {{DEBUG}} level,
> similar to how {{java.util.logging}} is doing it.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)