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

ASF GitHub Bot commented on NUTCH-2566:
---------------------------------------

sebastian-nagel closed pull request #314: NUTCH-2566 Fix exception log messages
URL: https://github.com/apache/nutch/pull/314
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/java/org/apache/nutch/crawl/CrawlDb.java 
b/src/java/org/apache/nutch/crawl/CrawlDb.java
index 05fc3c67d..7af3b6b19 100644
--- a/src/java/org/apache/nutch/crawl/CrawlDb.java
+++ b/src/java/org/apache/nutch/crawl/CrawlDb.java
@@ -134,7 +134,7 @@ public void update(Path crawlDb, Path[] segments, boolean 
normalize,
     try {
       boolean success = job.waitForCompletion(true);
       if (!success) {
-        String message = "Crawl job did not succeed, job status:"
+        String message = "CrawlDb update job did not succeed, job status:"
             + job.getStatus().getState() + ", reason: "
             + job.getStatus().getFailureInfo();
         LOG.error(message);
@@ -142,7 +142,7 @@ public void update(Path crawlDb, Path[] segments, boolean 
normalize,
         throw new RuntimeException(message);
       }
     } catch (IOException | InterruptedException | ClassNotFoundException e) {
-      LOG.error("Crawl job failed {}", e);
+      LOG.error("CrawlDb update job failed: {}", e.getMessage());
       NutchJob.cleanupAfterFailure(outPath, lock, fs);
       throw e;
     }
diff --git a/src/java/org/apache/nutch/crawl/CrawlDbMerger.java 
b/src/java/org/apache/nutch/crawl/CrawlDbMerger.java
index d8756fd5e..3a83e416e 100644
--- a/src/java/org/apache/nutch/crawl/CrawlDbMerger.java
+++ b/src/java/org/apache/nutch/crawl/CrawlDbMerger.java
@@ -159,7 +159,7 @@ public void merge(Path output, Path[] dbs, boolean 
normalize, boolean filter)
       }
       CrawlDb.install(job, output);
     } catch (IOException | InterruptedException | ClassNotFoundException e) {
-      LOG.error("CrawlDbMerge job failed {}", e);
+      LOG.error("CrawlDbMerge job failed: {}", e.getMessage());
       NutchJob.cleanupAfterFailure(outPath, lock, fs);
       throw e;
     }
diff --git a/src/java/org/apache/nutch/crawl/Generator.java 
b/src/java/org/apache/nutch/crawl/Generator.java
index c9096d688..92b337cfd 100644
--- a/src/java/org/apache/nutch/crawl/Generator.java
+++ b/src/java/org/apache/nutch/crawl/Generator.java
@@ -791,7 +791,7 @@ public Generator(Configuration conf) {
         throw new RuntimeException(message);
       }
     } catch (IOException | InterruptedException | ClassNotFoundException e) {
-      LOG.error("Generator job failed {}", e);
+      LOG.error("Generator job failed: {}", e.getMessage());
       NutchJob.cleanupAfterFailure(tempDir, lock, fs);
       throw e;
     }
@@ -858,7 +858,7 @@ public Generator(Configuration conf) {
         }
         CrawlDb.install(job, dbDir);
       } catch (IOException | InterruptedException | ClassNotFoundException e) {
-        LOG.error("Generator job failed {}", e);
+        LOG.error("Generator job failed: {}", e.getMessage());
         NutchJob.cleanupAfterFailure(tempDir, lock, fs);
         NutchJob.cleanupAfterFailure(tempDir2, lock, fs);
         throw e;
diff --git a/src/java/org/apache/nutch/crawl/LinkDb.java 
b/src/java/org/apache/nutch/crawl/LinkDb.java
index 37bfb7bfe..77f77b51a 100644
--- a/src/java/org/apache/nutch/crawl/LinkDb.java
+++ b/src/java/org/apache/nutch/crawl/LinkDb.java
@@ -238,7 +238,7 @@ public void invert(Path linkDb, Path[] segments, boolean 
normalize,
         throw new RuntimeException(message);
       }
     } catch (IOException | InterruptedException | ClassNotFoundException e) {
-      LOG.error("LinkDb job failed {}", e);
+      LOG.error("LinkDb job failed: {}", e.getMessage());
       LockUtil.removeLockFile(fs, lock);
       throw e;
     }
@@ -263,7 +263,7 @@ public void invert(Path linkDb, Path[] segments, boolean 
normalize,
           throw new RuntimeException(message);
         }
       } catch (IOException | InterruptedException | ClassNotFoundException e) {
-        LOG.error("LinkDb job failed {}", e);
+        LOG.error("LinkDb job failed: {}", e.getMessage());
         NutchJob.cleanupAfterFailure(newLinkDb, lock, fs);
         throw e;
       }
@@ -300,7 +300,7 @@ private static Job createJob(Configuration config, Path 
linkDb,
           conf.setBoolean(LinkDbFilter.URL_NORMALIZING, normalize);
         }
       } catch (Exception e) {
-        LOG.warn("LinkDb createJob: {}", e);
+        LOG.warn("LinkDb createJob:: {}", e.getMessage());
       }
     }
     job.setReducerClass(LinkDbMerger.LinkDbMergeReducer.class);
diff --git a/src/java/org/apache/nutch/crawl/LinkDbMerger.java 
b/src/java/org/apache/nutch/crawl/LinkDbMerger.java
index f2f0892a6..26b5592a3 100644
--- a/src/java/org/apache/nutch/crawl/LinkDbMerger.java
+++ b/src/java/org/apache/nutch/crawl/LinkDbMerger.java
@@ -132,7 +132,7 @@ public void merge(Path output, Path[] dbs, boolean 
normalize, boolean filter)
         throw new RuntimeException(message);
       }
     } catch (IOException | InterruptedException | ClassNotFoundException e) {
-      LOG.error("LinkDbMerge job failed {}", e);
+      LOG.error("LinkDbMerge job failed: {}", e.getMessage());
       throw e;
     }
     FileSystem fs = output.getFileSystem(getConf());
diff --git a/src/java/org/apache/nutch/hostdb/ReadHostDb.java 
b/src/java/org/apache/nutch/hostdb/ReadHostDb.java
index 408e3eab3..d44138146 100644
--- a/src/java/org/apache/nutch/hostdb/ReadHostDb.java
+++ b/src/java/org/apache/nutch/hostdb/ReadHostDb.java
@@ -208,7 +208,7 @@ private void readHostDb(Path hostDb, Path output, boolean 
dumpHomepages, boolean
         throw new RuntimeException(message);
       }
     } catch (IOException | InterruptedException | ClassNotFoundException e) {
-      LOG.error("ReadHostDb job failed {}", e);
+      LOG.error("ReadHostDb job failed: {}", e.getMessage());
       throw e;
     }
 
diff --git a/src/java/org/apache/nutch/hostdb/UpdateHostDb.java 
b/src/java/org/apache/nutch/hostdb/UpdateHostDb.java
index 720927877..7066f7ea1 100644
--- a/src/java/org/apache/nutch/hostdb/UpdateHostDb.java
+++ b/src/java/org/apache/nutch/hostdb/UpdateHostDb.java
@@ -144,7 +144,7 @@ private void updateHostDb(Path hostDb, Path crawlDb, Path 
topHosts,
 
       if (!preserveBackup && fs.exists(old)) fs.delete(old, true);
     } catch (Exception e) {
-      LOG.error("UpdateHostDb job failed {}", e);
+      LOG.error("UpdateHostDb job failed: {}", e.getMessage());
       NutchJob.cleanupAfterFailure(tempHostDb, lock, fs);
       throw e;
     }
diff --git a/src/java/org/apache/nutch/segment/SegmentMerger.java 
b/src/java/org/apache/nutch/segment/SegmentMerger.java
index 188ae69d2..b1f1d8948 100644
--- a/src/java/org/apache/nutch/segment/SegmentMerger.java
+++ b/src/java/org/apache/nutch/segment/SegmentMerger.java
@@ -748,7 +748,7 @@ public void merge(Path out, Path[] segs, boolean filter, 
boolean normalize,
         throw new RuntimeException(message);
       }
     } catch (IOException | InterruptedException | ClassNotFoundException e) {
-      LOG.error("SegmentMerger job failed {}", e);
+      LOG.error("SegmentMerger job failed: {}", e.getMessage());
       throw e;
     }
   }
diff --git a/src/java/org/apache/nutch/tools/warc/WARCExporter.java 
b/src/java/org/apache/nutch/tools/warc/WARCExporter.java
index 2921a9763..ee9879ad3 100644
--- a/src/java/org/apache/nutch/tools/warc/WARCExporter.java
+++ b/src/java/org/apache/nutch/tools/warc/WARCExporter.java
@@ -298,7 +298,7 @@ public int generateWARC(String output, List<Path> segments) 
throws IOException{
       LOG.info("WARCExporter: finished at {}, elapsed: {}", sdf.format(end),
           TimingUtil.elapsedTime(start, end));
     } catch (IOException | InterruptedException | ClassNotFoundException e) {
-      LOG.error("WARCExporter job failed {}", e);
+      LOG.error("WARCExporter job failed: {}", e.getMessage());
       return -1;
     }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Fix exception log messages
> --------------------------
>
>                 Key: NUTCH-2566
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2566
>             Project: Nutch
>          Issue Type: Improvement
>    Affects Versions: 1.15
>            Reporter: Sebastian Nagel
>            Assignee: Sebastian Nagel
>            Priority: Trivial
>             Fix For: 1.15
>
>
> Some log messages use erroneously {{"{}"}} in combination with a Throwable 
> object. That's not placed in the log message by org.slf4j.Logger but added 
> after the message:
> {noformat}
> CrawlDbMerge job failed {}
> org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does 
> not exist: file:...crawldb/current
> {noformat}



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

Reply via email to