[ 
https://issues.apache.org/jira/browse/LOG4J2-3021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17285700#comment-17285700
 ] 

Volkan Yazici commented on LOG4J2-3021:
---------------------------------------

Thanks for the report [~Marcono1234]! The corrections are in review.

> 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)

Reply via email to