Log.reset(); pw.println(" logging started"); } else if (cmd.equals("logEnd")) { Log.close(); pw.println(" logging ended"); } else if (cmd.equals("logShow")) { pw.println(Log.getContents()); pw.println("-----done logShow"); } else if (cmd.equals("on")) pw.println("Logging is " + (Log.isOn() ? "on" : "off")); Iterator iter = Debug.keySet().iterator(); while (iter.hasNext()) {
/** * ************************************************************************ * Sends a OPeNDAP DAP2 error to the client. * * @param de The OPeNDAP DAP2 exception that caused the problem. * @param response The <code>HttpServletResponse</code> for the client. */ public void dap2ExceptionHandler(DAP2Exception de, HttpServletResponse response) { //log.info("DODSServlet.dodsExceptionHandler (" + de.getErrorCode() + ") " + de.getErrorMessage()); if (Debug.isSet("showException")) { de.print(System.out); de.printStackTrace(); Log.printDODSException(de); } try { BufferedOutputStream eOut = new BufferedOutputStream(response.getOutputStream()); response.setHeader("Content-Description", "dods-error"); // This should probably be set to "plain" but this works, the // C++ slients don't barf as they would if I sent "plain" AND // the C++ don't expect compressed data if I do this... response.setHeader("Content-Encoding", ""); de.print(eOut); } catch (IOException ioe) { System.out.println("Cannot respond to client! IO Error: " + ioe.getMessage()); //log.error("Cannot respond to client! IO Error: " + ioe.getMessage()); } } /***************************************************************************/
System.out.println("Client: " + request.getRemoteHost()); System.out.println(rs.toString()); Log.println("Request dataset: '" + rs.getDataSet() + "' suffix: '" + rs.getRequestSuffix() + "' CE: '" + rs.getConstraintExpression() + "'");
System.out.println(pe); pe.printStackTrace(); Log.printThrowable(pe);