Index: /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/Collection.java
===================================================================
--- /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/Collection.java	(revision 13122)
+++ /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/Collection.java	(revision 13123)
@@ -33,4 +33,6 @@
 import java.util.HashMap;
 
+import org.apache.log4j.*;
+
 /**
  * Represents a collection in Greenstone. A collection is an extension of
@@ -43,4 +45,6 @@
 public class Collection 
     extends ServiceCluster {
+
+    static Category logger = Category.getInstance(org.greenstone.gsdl3.collection.Collection.class.getName());
 
     protected XMLTransformer transformer = null;
@@ -69,5 +73,5 @@
 	
 	if (this.site_home == null || this.cluster_name== null) {
-	    System.err.println("Collection: site_home and collection_name must be set before configure called!");
+	    logger.error("Collection: site_home and collection_name must be set before configure called!");
 	    return false;
 	}
@@ -97,5 +101,5 @@
 	
 	if (!coll_config_file.exists()) {
-	    System.err.println("Collection: couldn't configure collection: "+this.cluster_name+", "+coll_config_file+" does not exist");
+	    logger.error("Collection: couldn't configure collection: "+this.cluster_name+", "+coll_config_file+" does not exist");
 	    return null;
 	}
@@ -117,5 +121,5 @@
 	File build_config_file = new File(GSFile.collectionBuildConfigFile(this.site_home, this.cluster_name));
 	if (!build_config_file.exists()) {
-	    System.err.println("Collection: couldn't configure collection: "+this.cluster_name+", "+build_config_file+" does not exist");
+	    logger.error("Collection: couldn't configure collection: "+this.cluster_name+", "+build_config_file+" does not exist");
 	    return null;
 	}
@@ -176,5 +180,5 @@
 	}
 	
-	System.err.println("Collection: cant process system request, configure "+subset);
+	logger.error("Collection: cant process system request, configure "+subset);
 	return false;
     } 
Index: /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java
===================================================================
--- /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java	(revision 13122)
+++ /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java	(revision 13123)
@@ -36,4 +36,6 @@
 import java.util.Iterator;
 
+import org.apache.log4j.*;
+
 /* ServiceCluster - a groups of services that are related in some way
  * Implements ModuleInterface. Contains a list of services provided by the cluster, along with metadata about the cluster itself.
@@ -45,4 +47,6 @@
 public class ServiceCluster  
     implements ModuleInterface {
+
+    static Category logger = Category.getInstance(org.greenstone.gsdl3.collection.ServiceCluster.class.getName()); 
 
     protected static final String CONFIG_ENCODING = "utf-8";
@@ -134,13 +138,13 @@
 
 	if (this.site_home == null || this.cluster_name== null) {
-	    System.err.println("ServiceCluster: site_home and cluster_name must be set before configure called!");
-	    return false;
-	}
-	System.out.println("configuring service cluster");
+	    logger.error("site_home and cluster_name must be set before configure called!");
+	    return false;
+	}
+	logger.info("configuring service cluster");
 	// read the site configuration file
 	File config_file = new File(GSFile.siteConfigFile(this.site_home));
 
 	if (!config_file.exists()) {
-	    System.err.println("ServiceCluster: couldn't configure cluster: "+this.cluster_name +", "+config_file+" does not exist");
+	    logger.error("couldn't configure cluster: "+this.cluster_name +", "+config_file+" does not exist");
 	    return false;
 	}
@@ -148,5 +152,5 @@
 	Document doc = this.converter.getDOM(config_file, CONFIG_ENCODING);
 	if (doc == null) {
-	    System.err.println("ServiceCluster: couldn't parse config file "+config_file.getPath());
+	    logger.error("couldn't parse config file "+config_file.getPath());
 	    return false;
 	}
@@ -168,5 +172,5 @@
 	    if (!addMetadata(meta_list)) {
 		
-		System.err.println("ServiceCluster: couldn't configure the metadata");
+		logger.error(" couldn't configure the metadata");
 	    }
 	}
@@ -177,5 +181,5 @@
 	    if (!addDisplayItems(display_list)) {
 		
-		System.err.println("ServiceCluster: couldn't configure the display items");
+		logger.error("couldn't configure the display items");
 	    }
 	}
@@ -187,9 +191,9 @@
 	    // is this an error? could you ever have a service cluster
 	    // without service racks???
-	    System.err.println("ServiceCluster: cluster has no service racks!!");
+	    logger.error("cluster has no service racks!!");
 	} else {
 	    
 	    if (!configureServiceRack(service_rack_list, null)) {
-		System.err.println("ServiceCluster: couldn't configure the  service racks!!");
+		logger.error("couldn't configure the  service racks!!");
 		return false;
 	    }
@@ -255,5 +259,5 @@
 	NodeList nodes = service_rack_list.getElementsByTagName(GSXML.SERVICE_CLASS_ELEM);
 	if (nodes.getLength()==0) {
-	    System.err.println("ServiceCluster configuration error: cluster "+this.cluster_name+" has no service modules!");
+	    logger.error("ServiceCluster configuration error: cluster "+this.cluster_name+" has no service modules!");
 	    return false;
 	}
@@ -304,5 +308,5 @@
 		}
 	    } catch (Exception e) {
-		System.err.println("ServiceCluster Error:  configure exception: couldn't create service module:org.greenstone.gsdl3.service."+servicetype+"\n"+e.getMessage() + e.getClass() );
+		logger.error("configure exception: couldn't create service module:org.greenstone.gsdl3.service."+servicetype+"\n"+e.getMessage() + e.getClass() );
 		e.printStackTrace();
 		//return false;
@@ -343,5 +347,5 @@
 	Element mainResult = this.doc.createElement(GSXML.MESSAGE_ELEM);
 	if (requests.getLength()==0) {
-	    System.err.println("ServiceCluster.process: no requests for cluster:"+this.cluster_name);
+	    logger.error("no requests for cluster:"+this.cluster_name);
 	    // no requests
 	    return mainResult; // for now
@@ -354,5 +358,5 @@
 	    String clustername = GSPath.getFirstLink(to);
 	    if (!clustername.equals(this.cluster_name)){ 
-		System.err.println("ServiceCluster Error: cluster name wrong! was "+clustername+" should have been "+this.cluster_name);
+		logger.error("cluster name wrong! was "+clustername+" should have been "+this.cluster_name);
 		continue; // ignore this request
 	    }
@@ -368,5 +372,5 @@
 		
 		if (!this.service_map.containsKey(service)) {
-		    System.err.println("ServiceCluster Error: non-existant service, "+service+", specified!");
+		    logger.error("non-existant service, "+service+", specified!");
 		    continue;
 		}
@@ -459,5 +463,5 @@
 	    response = processSystemRequest(request);
 	} else { // unknown type
-	    System.err.println("ServiceCluster Error: cant handle request of type "+ type);
+	    logger.error("cant handle request of type "+ type);
 	    
 	}
@@ -520,5 +524,5 @@
 		response.appendChild(s);
 	    } else {
-		System.err.println("ServiceCluster: cant process system request, action "+action);
+		logger.error("cant process system request, action "+action);
 		continue;
 	    }
@@ -534,5 +538,5 @@
 	File configFile = new File(GSFile.siteConfigFile(this.site_home));
 	if (!configFile.exists() ) {
-	    System.err.println("ServiceCluster: site config file: "+configFile.getPath()+" not found!");
+	    logger.error("site config file: "+configFile.getPath()+" not found!");
 	    // wont be able to do any of the requests
 	    return false;
@@ -542,5 +546,5 @@
 	Document site_config_doc  = this.converter.getDOM(configFile);
 	if (site_config_doc == null) {
-	    System.err.println("ServiceCluster: could not read in site config file: "+configFile.getPath());
+	    logger.error("could not read in site config file: "+configFile.getPath());
 	    return false;
 	}
@@ -549,5 +553,5 @@
 	Element cluster_config_elem = GSXML.getNamedElement((Element)GSXML.getChildByTagName(site_config_elem, GSXML.CLUSTER_ELEM+GSXML.LIST_MODIFIER), GSXML.CLUSTER_ELEM, GSXML.NAME_ATT, this.cluster_name);
 	if (cluster_config_elem == null) {
-	    System.err.println("ServiceCluster: site config file: "+configFile.getPath()+" has no element for cluster "+this.cluster_name);
+	    logger.error("site config file: "+configFile.getPath()+" has no element for cluster "+this.cluster_name);
 	    // wont be able to do any of teh requests
 	    return false;
@@ -563,5 +567,5 @@
 	    return addMetadata(metadata_list);
 	} else {
-	    System.err.println("ServiceCluster: cant process system request, configure "+subset);
+	    logger.error("cannot process system request, configure "+subset);
 	    return false;
 	} 
Index: /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/XMLCollection.java
===================================================================
--- /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/XMLCollection.java	(revision 13122)
+++ /trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/XMLCollection.java	(revision 13123)
@@ -15,7 +15,11 @@
 import java.util.HashMap;
 
+import org.apache.log4j.*;
+
 /* for a collection that hasn't been built with greenstone build stuff. expects a documentList in the collectionConfig file, and it stores this. this is where doc level metadata comes from */
 public class XMLCollection 
     extends Collection {
+
+     static Category logger = Category.getInstance(org.greenstone.gsdl3.collection.XMLCollection.class.getName());
 
     protected Element document_list = null;
@@ -106,5 +110,5 @@
 	    response = processSystemRequest(request);
 	} else { // unknown type
-	    System.err.println("ServiceCluster Error: cant handle request of type "+ type);
+	    logger.error("cant handle request of type "+ type);
 	    
 	}
Index: /trunk/gsdl3/src/java/org/greenstone/gsdl3/comms/SOAPCommunicator.java
===================================================================
--- /trunk/gsdl3/src/java/org/greenstone/gsdl3/comms/SOAPCommunicator.java	(revision 13122)
+++ /trunk/gsdl3/src/java/org/greenstone/gsdl3/comms/SOAPCommunicator.java	(revision 13123)
@@ -36,4 +36,6 @@
 import org.w3c.dom.Element; 
 
+import org.apache.log4j.*;
+
 /*
  * The Client side of a SOAP Connection
@@ -45,4 +47,6 @@
 public class SOAPCommunicator
     extends Communicator {
+
+      static Category logger = Category.getInstance(org.greenstone.gsdl3.comms.SOAPCommunicator.class.getName());
 
     /** address of site to connect to */
@@ -61,10 +65,10 @@
 	String type = site_elem.getAttribute(GSXML.TYPE_ATT);
 	if (!type.equals(GSXML.COMM_TYPE_SOAP_JAVA)) {
-	    System.err.println("SOAPCommunicator: wrong type of site");
+	    logger.error("wrong type of site");
 	    return false;
 	}
 	remote_site_name_ = site_elem.getAttribute(GSXML.NAME_ATT);
 	if (remote_site_name_.equals("")) {
-	    System.err.println("SOAPCommunicator: must have name attribute in site element");
+	    logger.error("must have name attribute in site element");
 	    return false;
 	}
@@ -72,5 +76,5 @@
 	String local_site_name = site_elem.getAttribute(GSXML.LOCAL_SITE_ATT);
 	if (remote_site_address_.equals("") && local_site_name.equals("")) {
-	    System.err.println("SOAPCommunicator: must have address or localSite attributes in site element");
+	    logger.error("must have address or localSite attributes in site element");
 	    return false;
 	}
@@ -84,5 +88,5 @@
 	    call_.setTargetEndpointAddress( new java.net.URL(remote_site_address_) );
 	} catch (Exception e) {
-	    System.err.println("SOAPCommunicator.configure() Error: Exception occurred "+e);
+	    logger.error("SOAPCommunicator.configure() Error: Exception occurred "+e);
 	    return false;
 	}
@@ -118,5 +122,4 @@
 	if (message.getNamespaceURI() == null) {
 	    message_to_send = GSXML.duplicateWithNewNameNS(message.getOwnerDocument(), message, "gs3:"+message.getTagName(), "urn:foo", true);
-	    //System.err.println("**"+new XMLConverter().getPrettyString(new_message));
 	}
 	
@@ -158,5 +161,5 @@
 	Element response = comm.process(request_elem);
 	
-	System.err.println("response was "+converter.getPrettyString(response));
+	logger.error("response was "+converter.getPrettyString(response));
     }
 }
