Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

fix for NUTCH-391

Sami Siren17cf6471afa0
diff --git a/CHANGES.txt b/CHANGES.txt
index b06fc0b49..ab40e23b8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -50,6 +50,9 @@ Unreleased changes (0.9-dev)
17. NUTCH-383 - upgrade to Hadoop 0.7.1 and Lucene 2.0.0. (ab)
+18. NUTCH-391 - ParseUtil logs file contents to log file when it cannot
+ find parser (siren)
+
****************************** WARNING !!! ********************************
* This upgrade breaks data format compatibility. A tool 'convertdb' *
* was added to migrate existing CrawlDb-s to the new format. Segment data *
diff --git a/src/java/org/apache/nutch/parse/ParseUtil.java b/src/java/org/apache/nutch/parse/ParseUtil.java
index fa088a212..a747db341 100644
--- a/src/java/org/apache/nutch/parse/ParseUtil.java
+++ b/src/java/org/apache/nutch/parse/ParseUtil.java
@@ -68,8 +68,8 @@ public class ParseUtil {
parsers = this.parserFactory.getParsers(content.getContentType(), "");
} catch (ParserNotFound e) {
if (LOG.isWarnEnabled()) {
- LOG.warn("No suitable parser found when trying to parse content " +
- content);
+ LOG.warn("No suitable parser found when trying to parse content " + content.getUrl() +
+ " of type " + content.getContentType());
}
throw new ParseException(e.getMessage());
}
@@ -123,8 +123,8 @@ public class ParseUtil {
p = this.parserFactory.getParserById(extId);
} catch (ParserNotFound e) {
if (LOG.isWarnEnabled()) {
- LOG.warn("No suitable parser found when trying to parse content " +
- content);
+ LOG.warn("No suitable parser found when trying to parse content " + content.getUrl() +
+ " of type " + content.getContentType());
}
throw new ParseException(e.getMessage());
}