You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Steve Loughran (JIRA)" <ji...@apache.org> on 2018/07/07 14:58:00 UTC

[jira] [Commented] (HADOOP-15586) Fix wrong log statements in AbstractService

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

Steve Loughran commented on HADOOP-15586:
-----------------------------------------

* The one in notefailure looks wrong; I think I was intending to just log the exception name in there, so, that {{+exception}} should be replaced with {{, exception}}

Other changes, -1. We use SLF4J which supports parameterized mesages; the {} entries are expanded with the toString() calls of every object, downgrading to null if null. This expansion takes place only if the log is to be printed, so it is much more efficient than any string.format. See [SLF4J FAQ|https://www.slf4j.org/faq.html].

If you do come across code which still uses string concatenation over expansion, it's old code from the commons-logging era: when we switched (ongoing!) we changed the imports and types, but not the actual log statements, just to keep the size of the patches down.

thanks for your submission, let's see what jenkins says. 

> Fix wrong log statements in AbstractService
> -------------------------------------------
>
>                 Key: HADOOP-15586
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15586
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 2.9.0, 3.1.0
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Minor
>         Attachments: HADOOP-15586-001.patch
>
>
> There are some wrong logging statements in AbstractService, here is one example: 
> {code:java}
> LOG.debug("noteFailure {}" + exception);
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org