Revision 4811
Added by daigle over 15 years ago
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
334 | 334 |
* Close all db connections from the pool |
335 | 335 |
*/ |
336 | 336 |
public void destroy() { |
337 |
Logger logMetacat = Logger.getLogger(MetaCatServlet.class); |
|
337 | 338 |
// Close all db connection |
338 |
System.out.println("Destroying MetacatServlet");
|
|
339 |
logMetacat.warn("Destroying MetacatServlet");
|
|
339 | 340 |
timer.cancel(); |
340 | 341 |
IndexingQueue.getInstance().setMetacatRunning(false); |
341 | 342 |
DBConnectionPool.release(); |
... | ... | |
469 | 470 |
} |
470 | 471 |
} |
471 | 472 |
} catch (Exception e) { |
472 |
System.out.println("Exception:" + e.getMessage());
|
|
473 |
logMetacat.error("Exception:" + e.getMessage());
|
|
473 | 474 |
e.printStackTrace(); |
474 | 475 |
} |
475 | 476 |
|
... | ... | |
2072 | 2073 |
|
2073 | 2074 |
try { |
2074 | 2075 |
// Get the document indicated |
2075 |
System.out.println("params: " + params.toString());
|
|
2076 |
logMetacat.debug("params: " + params.toString());
|
|
2076 | 2077 |
|
2077 | 2078 |
String[] doctext = params.get("doctext"); |
2078 | 2079 |
String pub = null; |
... | ... | |
2175 | 2176 |
user, accNumber, action[0]); |
2176 | 2177 |
} catch (NullPointerException npe) { |
2177 | 2178 |
// MCD this seems a bit dubious, since many things can throw npe |
2178 |
System.out.println("writing with null acnumber");
|
|
2179 |
logMetacat.warn("writing with null acnumber");
|
|
2179 | 2180 |
newdocid = documentWrapper.write(dbConn, xml, pub, dtd, |
2180 | 2181 |
doAction, null, user, groups); |
2181 | 2182 |
EventLog.getInstance().log(request.getRemoteAddr(), |
... | ... | |
2700 | 2701 |
endDate = new Timestamp((format.parse(end)).getTime()); |
2701 | 2702 |
} |
2702 | 2703 |
} catch (ParseException e) { |
2703 |
System.out.println("Failed to created Timestamp from input.");
|
|
2704 |
logMetacat.error("Failed to created Timestamp from input.");
|
|
2704 | 2705 |
} |
2705 | 2706 |
|
2706 | 2707 |
// Request the report by passing the filter parameters |
... | ... | |
2924 | 2925 |
} |
2925 | 2926 |
} else if(action.equals("insertmultipart")) { |
2926 | 2927 |
if (username != null && !username.equals("public")) { |
2927 |
System.out.println("!!!!!!!!!!handling multipart insert");
|
|
2928 |
logMetacat.debug("!!!!!!!!!!handling multipart insert");
|
|
2928 | 2929 |
handleInsertMultipartAction(request, response, |
2929 | 2930 |
out, params, fileList, username, groupnames); |
2930 | 2931 |
} else { |
... | ... | |
2986 | 2987 |
// Get a reference to the file part of the form |
2987 | 2988 |
//FilePart filePart = (FilePart) fileList.get("datafile"); |
2988 | 2989 |
String fileName = fileList.get("filename"); |
2989 |
System.out.println("filename: " + fileName); |
|
2990 |
logMetacat.info("Uploading filename: " + fileName); |
|
2990 |
logMetacat.debug("Uploading filename: " + fileName); |
|
2991 | 2991 |
// Check if the right file existed in the uploaded data |
2992 | 2992 |
if (fileName != null) |
2993 | 2993 |
{ |
... | ... | |
3080 | 3080 |
} |
3081 | 3081 |
catch(Exception e) |
3082 | 3082 |
{ |
3083 |
System.out.println("error uploading text file via multipart: " + e.getMessage());
|
|
3083 |
logMetacat.error("error uploading text file via multipart: " + e.getMessage());
|
|
3084 | 3084 |
e.printStackTrace(); |
3085 | 3085 |
} |
3086 | 3086 |
} |
Also available in: Unified diff
Replace System.out.println statements with logMetacat statements.