You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/22 16:39:46 UTC
[GitHub] [ozone] ayushtkn commented on a change in pull request #2066: HDDS-5006. Use Log4j to print error messages for Datanode startup
ayushtkn commented on a change in pull request #2066:
URL: https://github.com/apache/ozone/pull/2066#discussion_r598889982
##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
##########
@@ -587,4 +587,15 @@ public CertificateClient getCertificateClient() {
public void setCertificateClient(CertificateClient client) {
dnCertClient = client;
}
+
+ @Override
+ public void printError(Throwable error) {
+ if (error.getMessage() == null || error.getMessage().length() == 0) {
+ //message could be null in case of NPE. This is unexpected so we can
+ //print out the stack trace.
+ LOG.error("Exception in HddsDatanodeService.", error);
+ } else {
+ LOG.error(error.getMessage().split("\n")[0]);
Review comment:
Guess can keep this only for both the cases :
```
LOG.error("Exception in HddsDatanodeService.", error);
```
Sometimes having trace of the exception really helps
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org