[ https://issues.apache.org/jira/browse/HADOOP-10571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16362207#comment-16362207 ]
Andras Bokor commented on HADOOP-10571: --------------------------------------- Thanks for the comments [~ajisakaa]! Please find my answers: * DNS.java: I was not confident here. The original author used getMessages() method and warn level that may indicates that the stacktrace was avoided on purpose. * AbstractService: The original code was {{LOG.debug("noteFailure " + exception, (Throwable) null);}}. Using null as Throwable means they avoided the stackstrace on purpose. * OpenFileCtx.java L709, L747, and L1233: Not sure. At info level I think they did not want to print the stacktrace and to keep the original message (which includes the class of the exceptions as well) we have to use toString(). Btw, one '{}' was missing from line 747. * OpenFileCtx.java and RpcProgramNfs3.java: handle.dumpFileHandle(): Addressed where debug level is used * OpenFileCtx.java L1113: Addressed * OpenFileCtx.java L2214: Addressed * DataNode.java L1939: Addressed * DataNode.java L2436: It has been already guraded * DataNode.java L2726: If we want to avoid the stacktrace we can't. If I pass ex, log4j will consider as Throwable so it will print the stacktrace * DataXceiver.java all: Same as Datanode:2726 * Gridmix.java L203: Addressed > Use Log.*(Object, Throwable) overload to log exceptions > ------------------------------------------------------- > > Key: HADOOP-10571 > URL: https://issues.apache.org/jira/browse/HADOOP-10571 > Project: Hadoop Common > Issue Type: Bug > Affects Versions: 2.4.0 > Reporter: Arpit Agarwal > Assignee: Andras Bokor > Priority: Major > Attachments: HADOOP-10571.01.patch, HADOOP-10571.01.patch, > HADOOP-10571.02.patch, HADOOP-10571.03.patch, HADOOP-10571.04.patch, > HADOOP-10571.05.patch, HADOOP-10571.06.patch, HADOOP-10571.07.patch > > > When logging an exception, we often convert the exception to string or call > {{.getMessage}}. Instead we can use the log method overloads which take > {{Throwable}} as a parameter. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org