diff options
Diffstat (limited to 'datarouter-prov')
-rw-r--r-- | datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java index fe9c4601..3f67efec 100644 --- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java +++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/reports/FeedReport.java @@ -83,7 +83,7 @@ public class FeedReport extends ReportBase { }
db.release(conn);
} catch (SQLException e) {
- e.printStackTrace();
+ logger.error(e);
}
logger.debug("Query time: " + (System.currentTimeMillis() - start) + " ms");
try (PrintWriter os = new PrintWriter(outfile)) {
@@ -91,6 +91,7 @@ public class FeedReport extends ReportBase { os.print(sb.toString());
} catch (FileNotFoundException e) {
System.err.println("File cannot be written: " + outfile);
+ logger.error(e);
}
}
@@ -129,6 +130,7 @@ public class FeedReport extends ReportBase { feedmap.put("pubcount", n + 1);
} catch (JSONException e) {
feedmap.put("pubcount", 1);
+ logger.error(e);
}
} else if (type.equals("del")) {
String subid = "" + rs.getInt("DELIVERY_SUBID");
@@ -137,6 +139,7 @@ public class FeedReport extends ReportBase { feedmap.put(subid, n + 1);
} catch (JSONException e) {
feedmap.put(subid, 1);
+ logger.error(e);
}
}
}
@@ -144,7 +147,7 @@ public class FeedReport extends ReportBase { }
db.release(conn);
} catch (SQLException e) {
- e.printStackTrace();
+ logger.error(e);
}
logger.debug("Query time: " + (System.currentTimeMillis() - start) + " ms");
try {
@@ -153,6 +156,7 @@ public class FeedReport extends ReportBase { os.close();
} catch (FileNotFoundException e) {
System.err.println("File cannot be written: " + outfile);
+ logger.error(e);
}
}
@@ -279,7 +283,7 @@ public class FeedReport extends ReportBase { *
* @param args
*/
- public static void main(String[] args) {
+ public void main(String[] args) {
int rtype = 0; // 0 -> day, 1 -> week, 2 -> month, 3 -> year
String infile = null;
String outfile = null;
@@ -350,6 +354,7 @@ public class FeedReport extends ReportBase { feedmap.put("pubcount", n + count);
} catch (JSONException e) {
feedmap.put("pubcount", count);
+ logger.error(e);
}
} else if (type.equals("del")) {
String subid = tt[3];
@@ -358,6 +363,7 @@ public class FeedReport extends ReportBase { feedmap.put(subid, n + count);
} catch (JSONException e) {
feedmap.put(subid, count);
+ logger.error(e);
}
}
}
@@ -379,7 +385,7 @@ public class FeedReport extends ReportBase { System.out.println(t);
} catch (Exception e) {
System.err.println(e);
- e.printStackTrace();
+ logger.error(e);
}
}
}
|