Index: lib/lsid_conf/log4j.properties
===================================================================
--- lib/lsid_conf/log4j.properties	(revision 2817)
+++ lib/lsid_conf/log4j.properties	(revision 2818)
@@ -20,5 +20,5 @@
 # EXAMPLE: Print only messages of level WARN or above in the package com.foo:
 # log4j.logger.com.foo=WARN
 
-#log4j.logger.edu.ucsb.nceas.metacat=INFO
-
+#log4j.logger.org.apache.axis.utils.NetworkUtils=DEBUG
+#log4j.logger.org.apache.axis.transport.http.QSWSDLHandler=DEBUG
Index: src/edu/ucsb/nceas/metacat/lsid/LSIDDataLookup.java
===================================================================
--- src/edu/ucsb/nceas/metacat/lsid/LSIDDataLookup.java	(revision 2817)
+++ src/edu/ucsb/nceas/metacat/lsid/LSIDDataLookup.java	(revision 2818)
@@ -24,12 +24,15 @@
 
 package edu.ucsb.nceas.metacat.lsid;
 
-import java.io.*;
-import java.net.*;
-
-//import java.sql.Connection;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.ResourceBundle;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import com.ibm.lsid.LSID;
 import com.ibm.lsid.server.LSIDServerException;
 
@@ -40,10 +43,11 @@
 	public static final int UNKNOWN = 1;
 	public static final int ABSTRACT = 2;
 	public static final int CONCRETE = 4;
+    
+    private static Log logger = LogFactory.getLog( "edu.ucsb.nceas.metacat.lsid" );
 
-
 	public LSIDDataLookup() throws LSIDServerException {
-        System.out.println("Creating LSIDDataLookup (Metacat).");
+        logger.info("Creating LSIDDataLookup (Metacat).");
   	}
 
 
@@ -64,9 +68,9 @@
 		// http://metacat.nceas.ucsb.edu/knb/metacat?action=read&qformat=xml&docid=knb-lter-gce.109.6
 		//
 		
-    ResourceBundle rb = ResourceBundle.getBundle("metacat-lsid");
-    String theServer = rb.getString("metacatserver");
-		System.out.println("the server is " + theServer);
+		ResourceBundle rb = ResourceBundle.getBundle("metacat-lsid");
+		String theServer = rb.getString("metacatserver");
+		logger.debug("the server is " + theServer);
 
 		String url = theServer + "?action=read&qformat=xml&docid=";
 		url = url + ns + "." + id + "." + ver;
@@ -74,10 +78,10 @@
 			URL theDoc = new URL(url);
 			docStream  = theDoc.openStream();
 		} catch (MalformedURLException mue) {
-         		System.out.println("MalformedURLException in LSIDDataLookup: " + mue);
+         		logger.error("MalformedURLException in LSIDDataLookup: " + mue);
          		mue.printStackTrace();
    		} catch (IOException ioe) {
-         		System.out.println("IOException in LSIDDataLookup: " + ioe);
+         		logger.error("IOException in LSIDDataLookup: " + ioe);
          		ioe.printStackTrace();
 		}
 
Index: src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityMetaData.java
===================================================================
--- src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityMetaData.java	(revision 2817)
+++ src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityMetaData.java	(revision 2818)
@@ -24,25 +24,16 @@
 
 package edu.ucsb.nceas.metacat.lsid;
 
-import java.io.InputStream;
+import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
-
-import com.ibm.lsid.LSID;
-import com.ibm.lsid.MetadataResponse;
-import com.ibm.lsid.MalformedLSIDException;
-
-import com.ibm.lsid.server.LSIDMetadataService;
-import com.ibm.lsid.server.LSIDServerException;
-import com.ibm.lsid.server.LSIDServiceConfig;
-
-import com.ibm.lsid.server.LSIDRequestContext;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.Reader;
 import java.io.StringReader;
-import java.io.InputStreamReader;
-import java.io.BufferedReader;
+import java.util.Hashtable;
+import java.util.ResourceBundle;
 
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
@@ -49,18 +40,29 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
-import java.util.Hashtable;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
-import edu.ucsb.nceas.metacat.client.*;
-import java.util.ResourceBundle;
+import com.ibm.lsid.LSID;
+import com.ibm.lsid.MalformedLSIDException;
+import com.ibm.lsid.MetadataResponse;
+import com.ibm.lsid.server.LSIDMetadataService;
+import com.ibm.lsid.server.LSIDRequestContext;
+import com.ibm.lsid.server.LSIDServerException;
+import com.ibm.lsid.server.LSIDServiceConfig;
 
+import edu.ucsb.nceas.metacat.client.Metacat;
+import edu.ucsb.nceas.metacat.client.MetacatFactory;
+import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
+
 public class LSIDAuthorityMetaData implements LSIDMetadataService {
 
 	private LSIDDataLookup lookup = null;
 	private static Hashtable currentLSIDs = new Hashtable();
-
+    private static Log logger = LogFactory.getLog( "edu.ucsb.nceas.metacat.lsid" );
+    
 	public void initService(LSIDServiceConfig cf) throws LSIDServerException {
-        System.out.println("Starting LSIDAuthorityMetadata (Metacat).");
+        logger.info("Starting LSIDAuthorityMetadata.");
 		lookup = new LSIDDataLookup();
 	}
 
@@ -84,7 +86,7 @@
 
 	private ByteArrayInputStream doMetadataRequest(LSID lsid)
 		throws LSIDServerException {
-		System.out.println("getting metadata for lsid " + lsid.getLsid());
+		logger.debug("getting metadata for lsid " + lsid.getLsid());
 		try {
 
 			String styleSheetName = null;
@@ -125,7 +127,7 @@
 				result.append(line);
 			}
 		} catch (IOException e) {
-			System.out.println("IOexception " + e);
+			logger.error("IOexception " + e);
 		}
 
 		return result.toString();
@@ -158,7 +160,7 @@
 				loop++;
 			}
 		} catch (IOException e) {
-			System.out.println("ioerror in LSIDAuthorityMetadata: " + e);
+			logger.error("ioerror in LSIDAuthorityMetadata: " + e);
 		}
 		return itIsEML;
 	}
@@ -194,7 +196,7 @@
 	 */
 
 	private String getMetaCatQuery(LSID lsid) {
-        System.out.println("getting Metacat Query for: " + lsid.toString());
+        logger.debug("getting Metacat Query for: " + lsid.toString());
 		String ns = lsid.getNamespace();
 		String id = lsid.getObject();
 		String ver = lsid.getRevision();
@@ -227,7 +229,7 @@
 	 * given a query string, query MetaCat and return the response
 	 */
 	private Reader getMetaCatResponse(String query) {
-        System.out.println("Querying the metacat server.");
+        logger.debug("Querying the metacat server.");
 		//  get the metacat server from the configuration file
 		//
 		ResourceBundle rb = ResourceBundle.getBundle("metacat-lsid");
@@ -239,9 +241,9 @@
 			r = m.query(new StringReader(query));
 
 		} catch (MetacatInaccessibleException mie) {
-			System.out.println("Metacat Inaccessible:\n" + mie.getMessage());
+            logger.error("Metacat Inaccessible:\n" + mie.getMessage());
 		} catch (Exception e) {
-			System.out.println("General exception:\n" + e.getMessage());
+			logger.error("General exception:\n" + e.getMessage());
 		}
 		return r;
 	}
@@ -251,7 +253,7 @@
 	 */
 	private InputStream parseMetaCatResponse(Reader reader, LSID theLSID) {
 		InputStream response = null;
-        System.out.println("Parsing the metacat response.");
+        logger.debug("Parsing the metacat response.");
 		// if there's more than one document, then return rdf listing the documents
 		// otherwise get the document and return rdf  based on it
 
@@ -333,10 +335,10 @@
 				result = doMetadataRequest(newLSID);
 
 			} catch (MalformedLSIDException e) {
-				System.out.println("problem generating LSID: " + e);
+                logger.error("problem generating LSID: " + e);
 				e.printStackTrace();
 			} catch (LSIDServerException e) {
-				System.out.println("problem generating LSID: " + e);
+                logger.error("problem generating LSID: " + e);
 				e.printStackTrace();
 			}
 		}
@@ -370,7 +372,7 @@
 			bufReader.close();
 
 		} catch (IOException e) {
-			System.out.println("error getting string from reader " + e);
+			logger.error("error getting string from reader " + e);
 		}
 		return response.toString();
 	}
Index: src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityMain.java
===================================================================
--- src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityMain.java	(revision 2817)
+++ src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityMain.java	(revision 2818)
@@ -24,37 +24,40 @@
 
 package edu.ucsb.nceas.metacat.lsid;
 
+import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-import java.util.regex.Matcher;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.ibm.lsid.ExpiringResponse;
 import com.ibm.lsid.LSID;
-import com.ibm.lsid.ExpiringResponse;
+import com.ibm.lsid.server.LSIDServerException;
+import com.ibm.lsid.server.LSIDServiceConfig;
+import com.ibm.lsid.server.impl.SimpleAuthority;
+import com.ibm.lsid.wsdl.HTTPLocation;
 import com.ibm.lsid.wsdl.LSIDDataPort;
 import com.ibm.lsid.wsdl.LSIDMetadataPort;
-
 import com.ibm.lsid.wsdl.SOAPLocation;
-import com.ibm.lsid.wsdl.HTTPLocation;
 
-import com.ibm.lsid.server.LSIDServerException;
-import com.ibm.lsid.server.LSIDServiceConfig;
-
-import com.ibm.lsid.server.impl.SimpleAuthority;
-
 public class LSIDAuthorityMain extends SimpleAuthority {
 
 	private LSIDDataLookup lookup = null;
-
+    private static Log logger = LogFactory.getLog( "edu.ucsb.nceas.metacat.lsid" );
+    
 	public void initService(LSIDServiceConfig cf) throws LSIDServerException {
-        System.out.println("Starting LSIDAuthorityMain (Metacat).");
+        logger.info("Starting LSIDAuthorityMain.");
 		lookup = new LSIDDataLookup();
 	}
 
 	public ExpiringResponse getKnownURIs() throws LSIDServerException {
+        logger.debug("In LSIDAuthorityMain.getKnownURIs()");
 		return null;
 	}
 
 	public LSIDMetadataPort[] getMetadataLocations(LSID lsid, String url) {
-		if (lookup == null)
+        logger.debug("In LSIDAuthorityMain.getMetadataLocations()");
+        if (lookup == null)
 			return null;
 
 		int lsType;
@@ -82,6 +85,7 @@
 	}
 
 	public LSIDDataPort[] getDataLocations(LSID lsid, String url) {
+        logger.debug("In LSIDAuthorityMain.getDataLocations()");
 		if (lookup == null)
 			return null;
 
@@ -122,23 +126,32 @@
 		public String baseURL;
 		
 		public HostDescriptor(String url) {
+            logger.debug("Creating a HostDescriptor for: " + url);
+            //Thread.dumpStack();
 			host = "localhost";
 			port = -1;
 			pathPrefix = "";
 			if (url != null || url.length() > 0) {
+                logger.debug("HostDescriptor: url is > 0 length");
 				Matcher m = HOST_PTN.matcher(url);
 				if (m.lookingAt()) {
 					host = m.group(1);
-					if ((m.group(2) != null) && (m.group(2).length() > 0))
+                    logger.debug("HostDescriptor.host: " + host);
+					if ((m.group(2) != null) && (m.group(2).length() > 0)) {
 						port = Integer.parseInt(m.group(2));
+                    }
+                    logger.debug("HostDescriptor.port: " + port);
 					pathPrefix = m.group(3);
+                    logger.debug("HostDescriptor.pathPrefix: " + pathPrefix);
 				}
 			}
-			if (port > 0)
+			if (port > 0) {
 				baseURL = "http://" + host + ":" + port +
 					pathPrefix + "/authority/";
-			else
+            } else {
 				baseURL = "http://" + host + pathPrefix + "/authority/";
+            }
+            logger.debug("HostDescriptor.baseURL: " + baseURL);
 		}
 	}
 }
Index: src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityData.java
===================================================================
--- src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityData.java	(revision 2817)
+++ src/edu/ucsb/nceas/metacat/lsid/LSIDAuthorityData.java	(revision 2818)
@@ -26,17 +26,21 @@
 
 import java.io.InputStream;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import com.ibm.lsid.server.LSIDDataService;
+import com.ibm.lsid.server.LSIDRequestContext;
 import com.ibm.lsid.server.LSIDServerException;
 import com.ibm.lsid.server.LSIDServiceConfig;
-import com.ibm.lsid.server.LSIDRequestContext;
 
 public class LSIDAuthorityData implements LSIDDataService {
 
 	private LSIDDataLookup lookup = null;
-
+    private static Log logger = LogFactory.getLog( "edu.ucsb.nceas.metacat.lsid" );
+    
 	public InputStream getData(LSIDRequestContext lsid) throws LSIDServerException {
-        System.out.println("Getting data (Metacat): " + lsid.getLsid().toString());
+        logger.debug("Getting data (Metacat): " + lsid.getLsid().toString());
 		if (lookup == null)
 			throw new LSIDServerException(500, "Cannot query database");
 		return lookup.lsidData(lsid.getLsid());
@@ -49,7 +53,7 @@
 	}
 
 	public void initService(LSIDServiceConfig cf) throws LSIDServerException {
-        System.out.println("Starting LSIDAuthorityData (Metacat).");
+        logger.info("Starting LSIDAuthorityData (Metacat).");
 		lookup = new LSIDDataLookup();
 	}
 }
