if(log.isDebugEnabled()) { log.error("CSMARTUL: " + e);
if(log.isErrorEnabled()) { log.error("CSMARTUL: ", e);
  private static void setURLToMonitor() {    Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.viewer.CSMARTUL");    JTextField tf =       new JTextField(ClientServletUtil.makeURL("localhost", agentPort));    JPanel panel = new JPanel();    panel.add(new JLabel("Agent URL:"));    panel.add(tf);    int result =       JOptionPane.showOptionDialog(null, panel, "Agent URL",				   JOptionPane.OK_CANCEL_OPTION,				   JOptionPane.PLAIN_MESSAGE,				   null, null, null);    if (result != JOptionPane.OK_OPTION)      return;    agentURL = tf.getText();    int startIndex;    int endIndex;    if (agentURL.startsWith("http://")) {      startIndex = 7;      endIndex = agentURL.indexOf(":", startIndex);      if (endIndex != -1)	agentHost = agentURL.substring(startIndex, endIndex);    }    startIndex = agentURL.lastIndexOf(':');    if (startIndex != -1) {      String s = agentURL.substring(startIndex+1);      try {        agentPort = Integer.parseInt(s);      } catch (Exception e) {        if(log.isDebugEnabled()) {          log.error("CSMARTUL: " + e);        }      }    }//      if (startIndex != -1) {//        endIndex = agentURL.lastIndexOf('/');//        if (endIndex != -1) {//  	String s = agentURL.substring(startIndex+1, endIndex);//  	try {//  	  agentPort = Integer.parseInt(s);//  	} catch (Exception e) {//            if(log.isDebugEnabled()) {//              log.error("CSMARTUL: " + e);//            }//  	}//        }//      }    reset(agentHost, agentPort);  }