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

Yiqun Lin edited comment on HDFS-13435 at 4/13/18 7:21 AM:
-----------------------------------------------------------

Seems I have made a mistake :P, as [~elgoiri] clarified, {{LOG.error("Cannot 
remove {}", path, e);}} should be a right way and the exception message and its 
stack info will both be logged.
 
But [~elgoiri] and [~ajayydv] mentioned a good point that we can enable some 
stack trace. I just take a quick glance across the project, maybe we can log 
stack trace relevant to State Store/Router operations. People who use RBF maybe 
care more of this, so printing the exception stack trace here will be a 
appropriate way.

Attach the updated patch:

* Have addressed the #2 comment from [~ywskycn]
* To make log consistent, not add the a dot at the end.
* Fix some wrong log type, from {{LOG.info}} to {{LOG.error}}.


was (Author: linyiqun):
Seems I have made a mistake :P, as [~elgoiri] clarified, {{LOG.error("Cannot 
remove {}", path, e);}} should be a right way and the exception message and its 
stack info will both be logged.
 
But [~elgoiri] and [~ajayydv] mentioned a good point that we can enable some 
stack trace. I just take a quick glance across the project, maybe we can log 
stack trace relevant to State Store/Router operations. People who use RBF maybe 
not familiar with these code base. Printing the exception stack trace will be a 
appropriate way.

Attach the updated patch:

* Have addressed the #2 comment from [~ywskycn]
* To make log consistent, not add the a dot at the end.
* Fix some wrong log type, from {{LOG.info}} to {{LOG.error}}.

> RBF: Fix wrong error loggings
> -----------------------------
>
>                 Key: HDFS-13435
>                 URL: https://issues.apache.org/jira/browse/HDFS-13435
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>    Affects Versions: 3.0.1
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>            Priority: Major
>         Attachments: HDFS-13435.001.patch, HDFS-13435.002.patch
>
>
> There are many places that using {{Logger.error(String format, Object... 
> arguments)}} incorrectly.
>  A example:
> {code:java}
> LOG.error("Cannot remove {}", path, e);
> {code}
> The exception passed here is no meaning and won't be printed. Actually it 
> should be update to
> {code:java}
> LOG.error("Cannot remove {}: {}.", path, e.getMessage());
> {code}
> or 
> {code:java}
> LOG.error("Cannot remove " +  path, e));
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to