Index: test/edu/ucsb/nceas/metacat/dataone/MockCNode.java
===================================================================
--- test/edu/ucsb/nceas/metacat/dataone/MockCNode.java	(revision 6541)
+++ test/edu/ucsb/nceas/metacat/dataone/MockCNode.java	(revision 6542)
@@ -71,7 +71,7 @@
     public String lookupNodeBaseUrl(String nodeId) throws ServiceFailure, NotImplemented {
 
     	try {
-			return MNodeService.getInstance().getCapabilities().getBaseURL();
+			return MNodeService.getInstance(null).getCapabilities().getBaseURL();
 		} catch (Exception e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
Index: test/edu/ucsb/nceas/metacat/dataone/MNodeServiceTest.java
===================================================================
--- test/edu/ucsb/nceas/metacat/dataone/MNodeServiceTest.java	(revision 6541)
+++ test/edu/ucsb/nceas/metacat/dataone/MNodeServiceTest.java	(revision 6542)
@@ -165,8 +165,8 @@
       guid.setValue("testGet." + System.currentTimeMillis());
       InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
       SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-      Identifier pid = MNodeService.getInstance().create(session, guid, object, sysmeta);
-      InputStream result = MNodeService.getInstance().get(session, guid);
+      Identifier pid = MNodeService.getInstance(request).create(session, guid, object, sysmeta);
+      InputStream result = MNodeService.getInstance(request).get(session, guid);
       // go back to beginning of original stream
       object.reset();
       // check
@@ -238,8 +238,8 @@
       guid.setValue("testGetSystemMetadata." + System.currentTimeMillis());
       InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
       SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-      Identifier pid = MNodeService.getInstance().create(session, guid, object, sysmeta);
-      SystemMetadata newsysmeta = MNodeService.getInstance().getSystemMetadata(session, pid);
+      Identifier pid = MNodeService.getInstance(request).create(session, guid, object, sysmeta);
+      SystemMetadata newsysmeta = MNodeService.getInstance(request).getSystemMetadata(session, pid);
       assertEquals(newsysmeta.getIdentifier().getValue(), sysmeta.getIdentifier().getValue());
       
     } catch (UnsupportedEncodingException e) {
@@ -306,7 +306,7 @@
       guid.setValue("testCreate." + System.currentTimeMillis());
       InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
       SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-      Identifier pid = MNodeService.getInstance().create(session, guid, object, sysmeta);
+      Identifier pid = MNodeService.getInstance(request).create(session, guid, object, sysmeta);
       assertEquals(guid.getValue(), pid.getValue());
     } catch (UnsupportedEncodingException e) {
       e.printStackTrace();
@@ -368,8 +368,8 @@
       guid.setValue("testDelete." + System.currentTimeMillis());
       InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
       SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-      Identifier pid = MNodeService.getInstance().create(session, guid, object, sysmeta);
-      Identifier deletedPid = MNodeService.getInstance().delete(session, pid);
+      Identifier pid = MNodeService.getInstance(request).create(session, guid, object, sysmeta);
+      Identifier deletedPid = MNodeService.getInstance(request).delete(session, pid);
       assertEquals(pid.getValue(), deletedPid.getValue());
       
     } catch (UnsupportedEncodingException e) {
@@ -398,17 +398,17 @@
       Identifier newPid = new Identifier();
       newPid.setValue("testUpdate." + System.currentTimeMillis());
       Identifier pid = 
-        MNodeService.getInstance().create(session, guid, object, sysmeta);
+        MNodeService.getInstance(request).create(session, guid, object, sysmeta);
       
       SystemMetadata newSysMeta = createSystemMetadata(newPid, session.getSubject(), object);
             
       // do the update
       Identifier updatedPid = 
-        MNodeService.getInstance().update(session, pid, object, newPid, newSysMeta);
+        MNodeService.getInstance(request).update(session, pid, object, newPid, newSysMeta);
       
       // get the updated system metadata
       SystemMetadata updatedSysMeta = 
-        MNodeService.getInstance().getSystemMetadata(session, updatedPid);
+        MNodeService.getInstance(request).getSystemMetadata(session, updatedPid);
 
       assertEquals(updatedPid.getValue(), newPid.getValue());
 //      assertTrue(updatedSysMeta.getObsolete(0).getValue().equals(pid.getValue()));
@@ -476,13 +476,13 @@
         InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
         SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
         // save locally
-        Identifier pid = MNodeService.getInstance().create(session, guid, object, sysmeta);
+        Identifier pid = MNodeService.getInstance(request).create(session, guid, object, sysmeta);
         // get our node reference (attempting to replicate with self)
-        NodeReference sourceNode = MNodeService.getInstance().getCapabilities().getIdentifier();
+        NodeReference sourceNode = MNodeService.getInstance(request).getCapabilities().getIdentifier();
         // attempt to replicate with ourselves -- this should fail!
       boolean result = false;
       try {
-        result = MNodeService.getInstance().replicate(session, sysmeta, sourceNode);
+        result = MNodeService.getInstance(request).replicate(session, sysmeta, sourceNode);
       } catch (Exception inu) {
         // we are expecting this to fail since we already have the doc
         result = true;
@@ -506,8 +506,8 @@
       guid.setValue("testGetSystemMetadata." + System.currentTimeMillis());
       InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
       SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-      Identifier pid = MNodeService.getInstance().create(session, guid, object, sysmeta);
-      DescribeResponse describeResponse = MNodeService.getInstance().describe(session, pid);
+      Identifier pid = MNodeService.getInstance(request).create(session, guid, object, sysmeta);
+      DescribeResponse describeResponse = MNodeService.getInstance(request).describe(session, pid);
       assertEquals(describeResponse.getDataONE_Checksum().getValue(), sysmeta.getChecksum().getValue());
       assertEquals(describeResponse.getDataONE_ObjectFormatIdentifier(), sysmeta.getFmtid());
       
@@ -574,8 +574,8 @@
       guid.setValue("testGetChecksum." + System.currentTimeMillis());
       InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
       SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-      Identifier pid = MNodeService.getInstance().create(session, guid, object, sysmeta);
-      Checksum checksum = MNodeService.getInstance().getChecksum(session, pid, "MD5");
+      Identifier pid = MNodeService.getInstance(request).create(session, guid, object, sysmeta);
+      Checksum checksum = MNodeService.getInstance(request).getChecksum(session, pid, "MD5");
       assertEquals(checksum.getValue(), sysmeta.getChecksum().getValue());
     
     } catch (UnsupportedEncodingException e) {
@@ -651,7 +651,7 @@
         testCreate();
         // now check that we have at least one
         ObjectList objectList = 
-          MNodeService.getInstance().listObjects(session, startTime, endTime, 
+          MNodeService.getInstance(request).listObjects(session, startTime, endTime, 
               objectFormatId, replicaStatus, start, count);
         assertNotNull(objectList);
         assertTrue(objectList.getCount() == count);
@@ -668,7 +668,7 @@
   public void testGetCapabilities() {
       printTestHeader("testGetCapabilities");
     try {
-      Node node = MNodeService.getInstance().getCapabilities();
+      Node node = MNodeService.getInstance(request).getCapabilities();
       assertNotNull(node);
       // TODO: should probably test other parts of the node information
     } catch (Exception e) {
@@ -686,7 +686,7 @@
         Date startTime = sdf.parse("2010-01-01");
         Date endTime = new Date();
       MonitorList monitorList = 
-        MNodeService.getInstance().getOperationStatistics(
+        MNodeService.getInstance(request).getOperationStatistics(
             session, 
             startTime, 
             endTime, 
@@ -706,7 +706,7 @@
   public void testPing() {
 
     try {
-      boolean pingable = MNodeService.getInstance().ping();
+      boolean pingable = MNodeService.getInstance(request).ping();
       assertTrue(pingable);
       
     } catch (NotImplemented e) {
@@ -747,7 +747,7 @@
         pid.setValue("testSynchronizationFailed." + System.currentTimeMillis());
         InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
         SystemMetadata sysmeta = createSystemMetadata(pid, session.getSubject(), object);
-        Identifier retPid = MNodeService.getInstance().create(session, pid, object, sysmeta);
+        Identifier retPid = MNodeService.getInstance(request).create(session, pid, object, sysmeta);
         assertEquals(retPid.getValue(), pid.getValue());
         
         // pretend the sync failed
@@ -754,7 +754,7 @@
       SynchronizationFailed syncFailed = 
         new SynchronizationFailed("0000", "Testing Synch Failure");
       syncFailed.setPid(pid.getValue());
-      MNodeService.getInstance().synchronizationFailed(session, syncFailed );
+      MNodeService.getInstance(request).synchronizationFailed(session, syncFailed );
     } catch (Exception e) {
       e.printStackTrace();
         fail("Unexpected error: " + e.getMessage());
@@ -778,7 +778,7 @@
     int count = 1;
     
     try {
-      log = MNodeService.getInstance().getLogRecords(session, fromDate, toDate, 
+      log = MNodeService.getInstance(request).getLogRecords(session, fromDate, toDate, 
         event, start, count);
       
       assertNotNull(log);      
@@ -825,7 +825,7 @@
       InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
       SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
       Identifier pid = 
-        MNodeService.getInstance().create(session, guid, object, sysmeta);
+        MNodeService.getInstance(request).create(session, guid, object, sysmeta);
       // set the access
       AccessPolicy accessPolicy = new AccessPolicy();
       AccessRule allow = new AccessRule();
@@ -836,11 +836,11 @@
       accessPolicy.addAllow(allow);
       
       accessWasSet = 
-        MNodeService.getInstance().setAccessPolicy(session, pid, accessPolicy);
+        MNodeService.getInstance(request).setAccessPolicy(session, pid, accessPolicy);
       assertTrue(accessWasSet);
       // test that it is enforced
       session.setSubject(publicSubject);
-      boolean isAuthorized = MNodeService.getInstance().isAuthorized(session, pid, Permission.WRITE);
+      boolean isAuthorized = MNodeService.getInstance(request).isAuthorized(session, pid, Permission.WRITE);
       assertTrue(isAuthorized);
 
     } catch (UnsupportedEncodingException e) {
@@ -907,9 +907,9 @@
       InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
       SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
       Identifier pid = 
-        MNodeService.getInstance().create(session, guid, object, sysmeta);
+        MNodeService.getInstance(request).create(session, guid, object, sysmeta);
       boolean isAuthorized = 
-        MNodeService.getInstance().isAuthorized(session, pid, Permission.READ);
+        MNodeService.getInstance(request).isAuthorized(session, pid, Permission.READ);
       assertEquals(isAuthorized, true);
       
     } catch (UnsupportedEncodingException e) {
Index: test/edu/ucsb/nceas/metacat/dataone/CNodeServiceTest.java
===================================================================
--- test/edu/ucsb/nceas/metacat/dataone/CNodeServiceTest.java	(revision 6541)
+++ test/edu/ucsb/nceas/metacat/dataone/CNodeServiceTest.java	(revision 6542)
@@ -30,10 +30,13 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import javax.servlet.http.HttpServletRequest;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.wicket.protocol.http.MockHttpServletRequest;
 import org.dataone.service.util.Constants;
 import org.dataone.service.exceptions.InsufficientResources;
 import org.dataone.service.exceptions.InvalidRequest;
@@ -117,7 +120,7 @@
 			guid.setValue("testRegisterSystemMetadata." + System.currentTimeMillis());
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			return retGuid;
         } catch(Exception e) {
@@ -138,10 +141,10 @@
 			guid.setValue("testGetSystemMetadata." + System.currentTimeMillis());
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			// get it
-			SystemMetadata retSysmeta = CNodeService.getInstance().getSystemMetadata(session, guid);
+			SystemMetadata retSysmeta = CNodeService.getInstance(request).getSystemMetadata(session, guid);
 			// check it
 			assertEquals(sysmeta.getIdentifier().getValue(), retSysmeta.getIdentifier().getValue());
         } catch(Exception e) {
@@ -161,7 +164,7 @@
 		    int start = 0;
 		    int count = 1;
 	    
-		    Log log = CNodeService.getInstance().getLogRecords(session, fromDate, toDate, 
+		    Log log = CNodeService.getInstance(request).getLogRecords(session, fromDate, toDate, 
 		    	event, start, count);
 		    assertNotNull(log);
 		    assertTrue(log.getCount() == count);
@@ -182,7 +185,7 @@
 			guid.setValue("testCreate." + System.currentTimeMillis());
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-			Identifier pid = CNodeService.getInstance().create(session, guid, object, sysmeta);
+			Identifier pid = CNodeService.getInstance(request).create(session, guid, object, sysmeta);
 			assertEquals(guid, pid);
         } catch(Exception e) {
         	e.printStackTrace();
@@ -199,10 +202,10 @@
 			guid.setValue("testGet." + System.currentTimeMillis());
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
-			Identifier pid = CNodeService.getInstance().create(session, guid, object, sysmeta);
+			Identifier pid = CNodeService.getInstance(request).create(session, guid, object, sysmeta);
 			assertEquals(guid.getValue(), pid.getValue());
 			// get it
-			InputStream retObject = CNodeService.getInstance().get(session, pid);
+			InputStream retObject = CNodeService.getInstance(request).get(session, pid);
 			// check it
 			object.reset();
 			assertTrue(IOUtils.contentEquals(object, retObject));
@@ -225,15 +228,15 @@
 			describePid.setValue("describePid." + System.currentTimeMillis());
 			sysmeta.setObsoletes(describePid);
 			// save it
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			// save the other
 			InputStream object2 = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata describeSysmeta = createSystemMetadata(describePid, session.getSubject(), object2);
-			Identifier retDescribePid = CNodeService.getInstance().registerSystemMetadata(session, describePid, describeSysmeta);
+			Identifier retDescribePid = CNodeService.getInstance(request).registerSystemMetadata(session, describePid, describeSysmeta);
 			assertEquals(describePid.getValue(), retDescribePid.getValue());
 			// check it
-			boolean result = CNodeService.getInstance().assertRelation(session, guid, "obsoletes", describePid);
+			boolean result = CNodeService.getInstance(request).assertRelation(session, guid, "obsoletes", describePid);
 			assertTrue(result);
         } catch(Exception e) {
         	e.printStackTrace();
@@ -251,10 +254,10 @@
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
 			// save it
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			// check it
-			Checksum checksum = CNodeService.getInstance().getChecksum(session, guid);
+			Checksum checksum = CNodeService.getInstance(request).getChecksum(session, guid);
 			assertEquals(sysmeta.getChecksum().getValue(), checksum.getValue());
         } catch(Exception e) {
             fail("Unexpected error: " + e.getMessage());
@@ -265,7 +268,7 @@
 	    printTestHeader("testListNodes");
 
 	    try {
-	    	CNodeService.getInstance().listNodes();
+	    	CNodeService.getInstance(request).listNodes();
         } catch(NotImplemented e) {
         	// expecting not implemented
             assertTrue(true);
@@ -282,7 +285,7 @@
 			Identifier guid = new Identifier();
 			guid.setValue("testReserveIdentifier." + System.currentTimeMillis());
 			// reserve it
-			boolean result = CNodeService.getInstance().reserveIdentifier(session, guid);
+			boolean result = CNodeService.getInstance(request).reserveIdentifier(session, guid);
 			assertTrue(result);
 	    } catch(NotImplemented ni) {
         	// this is not implemented in Metacat
@@ -304,10 +307,10 @@
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
 			
 			// save it
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			// search for it
-			ObjectList objectList = CNodeService.getInstance().search(session, null, null);
+			ObjectList objectList = CNodeService.getInstance(request).search(session, null, null);
 			// check it
 			assertNotNull(objectList);
 			boolean result = false;
@@ -334,15 +337,15 @@
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
 			// save it
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			Subject rightsHolder = new Subject();
 			rightsHolder.setValue("newUser");
 			// set it
-			Identifier retPid = CNodeService.getInstance().setOwner(session, guid, rightsHolder);
+			Identifier retPid = CNodeService.getInstance(request).setOwner(session, guid, rightsHolder);
 			assertEquals(guid, retPid);
 			// get it
-			sysmeta = CNodeService.getInstance().getSystemMetadata(session, guid);
+			sysmeta = CNodeService.getInstance(request).getSystemMetadata(session, guid);
 			assertNotNull(sysmeta);
 			// check it
 			assertEquals(rightsHolder.getValue(), sysmeta.getRightsHolder().getValue());
@@ -362,7 +365,7 @@
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
 			// save it
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			AccessPolicy accessPolicy = new AccessPolicy();
 			AccessRule accessRule = new AccessRule();
@@ -372,10 +375,10 @@
 			accessRule.addSubject(publicSubject);
 			accessPolicy.addAllow(accessRule);
 			// set it
-			boolean result = CNodeService.getInstance().setAccessPolicy(session, guid, accessPolicy );
+			boolean result = CNodeService.getInstance(request).setAccessPolicy(session, guid, accessPolicy );
 			assertTrue(result);
 			// check it
-			result = CNodeService.getInstance().isAuthorized(session, guid, Permission.WRITE);
+			result = CNodeService.getInstance(request).isAuthorized(session, guid, Permission.WRITE);
 			assertTrue(result);
         } catch(Exception e) {
             fail("Unexpected error: " + e.getMessage());
@@ -392,7 +395,7 @@
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
 			// save it
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			// check it
 			Subject publicSubject = new Subject();
@@ -399,12 +402,12 @@
 			publicSubject.setValue(Constants.SUBJECT_PUBLIC);
 			session.setSubject(publicSubject);
 			// public read
-			boolean result = CNodeService.getInstance().isAuthorized(session, guid, Permission.READ);
+			boolean result = CNodeService.getInstance(request).isAuthorized(session, guid, Permission.READ);
 			assertTrue(result);
 			// not public write
 			try {
 				result = false;
-				result = CNodeService.getInstance().isAuthorized(session, guid, Permission.WRITE);
+				result = CNodeService.getInstance(request).isAuthorized(session, guid, Permission.WRITE);
 				fail("Public WRITE should be denied");
 			} catch (NotAuthorized nae) {
 				result = true;
@@ -425,7 +428,7 @@
 			InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8"));
 			SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object);
 			// save it
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			
 			ReplicationPolicy policy = new ReplicationPolicy();
@@ -433,10 +436,10 @@
 			node.setValue("testNode");
 			policy.addPreferredMemberNode(node );
 			// set it
-			boolean result = CNodeService.getInstance().setReplicationPolicy(session, guid, policy);
+			boolean result = CNodeService.getInstance(request).setReplicationPolicy(session, guid, policy);
 			assertTrue(result);
 			// get it
-			sysmeta = CNodeService.getInstance().getSystemMetadata(session, guid);
+			sysmeta = CNodeService.getInstance(request).getSystemMetadata(session, guid);
 			assertNotNull(sysmeta);
 			// check it
 			assertEquals(policy.getPreferredMemberNode(0).getValue(), sysmeta.getReplicationPolicy().getPreferredMemberNode(0).getValue());
@@ -463,14 +466,14 @@
 			replica.setReplicaVerified(new Date());
 			sysmeta.addReplica(replica );
 			// save it
-			Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
+			Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, sysmeta);
 			assertEquals(guid.getValue(), retGuid.getValue());
 			// set it
 			ReplicationStatus status = ReplicationStatus.COMPLETED;
-			boolean result = CNodeService.getInstance().setReplicationStatus(session, guid, replicaMemberNode, status);
+			boolean result = CNodeService.getInstance(request).setReplicationStatus(session, guid, replicaMemberNode, status);
 			assertTrue(result);
 			// get it
-			sysmeta = CNodeService.getInstance().getSystemMetadata(session, guid);
+			sysmeta = CNodeService.getInstance(request).getSystemMetadata(session, guid);
 			assertNotNull(sysmeta);
 			// check it
 			assertEquals(status, sysmeta.getReplica(0).getReplicationStatus());
@@ -506,7 +509,7 @@
   	ObjectFormatList objectFormatList;
   	
   	try {
-	    objectFormatList = CNodeService.getInstance().listFormats();
+	    objectFormatList = CNodeService.getInstance(request).listFormats();
 	  	assertTrue(objectFormatList.getTotal() >= formatsCount);
   	
   	} catch (InvalidRequest e) {
@@ -545,7 +548,7 @@
     try {
 	    
 			String result = 
-				CNodeService.getInstance().getFormat(fmtid).getFmtid().getValue();
+				CNodeService.getInstance(request).getFormat(fmtid).getFmtid().getValue();
 	  	System.out.println("Expected result: " + knownFormat);
 	  	System.out.println("Found    result: " + result);
 	  	assertTrue(result.equals(knownFormat));
@@ -586,7 +589,7 @@
   	try {
   		
 	    ObjectFormat objectFormat = 
-	    	CNodeService.getInstance().getFormat(fmtid);
+	    	CNodeService.getInstance(request).getFormat(fmtid);
       
   	} catch (Exception e) {
 	    
Index: test/edu/ucsb/nceas/metacat/dataone/D1NodeServiceTest.java
===================================================================
--- test/edu/ucsb/nceas/metacat/dataone/D1NodeServiceTest.java	(revision 6541)
+++ test/edu/ucsb/nceas/metacat/dataone/D1NodeServiceTest.java	(revision 6542)
@@ -36,6 +36,7 @@
 import java.security.NoSuchAlgorithmException;
 import java.util.Date;
 
+import org.apache.wicket.protocol.http.MockHttpServletRequest;
 import org.dataone.client.ObjectFormatCache;
 import org.dataone.service.util.Constants;
 import org.dataone.service.util.TypeMarshaller;
@@ -60,11 +61,15 @@
  */
 public class D1NodeServiceTest extends MCTestCase {   
     
-    /**
+    protected MockHttpServletRequest request;
+
+	/**
     * constructor for the test
     */
     public D1NodeServiceTest(String name) {
         super(name);
+        // set up the fake request (for logging)
+        request = new MockHttpServletRequest(null, null, null);
     }
   
     /**
Index: test/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastServiceTest.java
===================================================================
--- test/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastServiceTest.java	(revision 6541)
+++ test/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastServiceTest.java	(revision 6542)
@@ -28,9 +28,12 @@
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 
+import javax.servlet.http.HttpServletRequest;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.apache.wicket.protocol.http.MockHttpServletRequest;
 import org.dataone.service.types.v1.Identifier;
 import org.dataone.service.types.v1.Session;
 import org.dataone.service.types.v1.SystemMetadata;
@@ -60,7 +63,9 @@
 		}
 			
 	}
-		
+
+	private HttpServletRequest request;
+
     /**
     * constructor for the test
     */
@@ -67,6 +72,8 @@
     public HazelcastServiceTest(String name) {
         super(name);
 
+        // set up the fake request (for logging)
+        request = new MockHttpServletRequest(null, null, null);
     }
     
     /**
@@ -116,7 +123,7 @@
 			systemMetadataMap.put(guid, sysmeta);
 			
 			// get it from the store
-			SystemMetadata sysmetaFromStore = CNodeService.getInstance().getSystemMetadata(session, guid);
+			SystemMetadata sysmetaFromStore = CNodeService.getInstance(request).getSystemMetadata(session, guid);
 			assertNotNull(sysmetaFromStore);
 
 		} catch (Exception e) {
Index: test/edu/ucsb/nceas/metacattest/EventLogTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/EventLogTest.java	(revision 6541)
+++ test/edu/ucsb/nceas/metacattest/EventLogTest.java	(revision 6542)
@@ -60,7 +60,7 @@
      */
     public void testLog()
     {
-        EventLog.getInstance().log("192.168.1.103", "public", "test.2.1", "read");
+        EventLog.getInstance().log("192.168.1.103", "Mozilla", "public", "test.2.1", "read");
         assertTrue(1 == 1);
     }
 
Index: src/xmltables-oracle.sql
===================================================================
--- src/xmltables-oracle.sql	(revision 6541)
+++ src/xmltables-oracle.sql	(revision 6542)
@@ -527,6 +527,7 @@
 CREATE TABLE access_log (
   entryid       NUMBER(20),     -- the identifier for the log event
   ip_address    VARCHAR2(512),  -- the ip address inititiating the event
+  user_agent    VARCHAR2(512),  -- the user agent for the request
   principal     VARCHAR2(512),  -- the user initiiating the event
   docid         VARCHAR2(250),	-- the document id #
   event         VARCHAR2(512),  -- the code symbolizing the event type
Index: src/upgrade-db-to-1.10.0-postgres.sql
===================================================================
--- src/upgrade-db-to-1.10.0-postgres.sql	(revision 6541)
+++ src/upgrade-db-to-1.10.0-postgres.sql	(revision 6542)
@@ -58,6 +58,11 @@
 */
 ALTER TABLE xml_access ADD COLUMN guid text;
 
+/**
+ * track the user-agent for the request
+ */
+ALTER TABLE acces_log ADD COLUMN user_agent VARCHAR(512);
+
 /*
  * Register the DataONE schemas
  */
Index: src/xmltables-postgres.sql
===================================================================
--- src/xmltables-postgres.sql	(revision 6541)
+++ src/xmltables-postgres.sql	(revision 6542)
@@ -390,7 +390,8 @@
 CREATE TABLE access_log (
   entryid       INT8 default nextval ('access_log_id_seq'), -- the identifier for the log event
   ip_address    VARCHAR(512),   -- the ip address inititiating the event
-  principal     VARCHAR(512),   -- the user initiiating the event
+  user_agent    VARCHAR(512),   -- the user agent for the request
+  principal     VARCHAR(512),   -- the user initiating the event
   docid         VARCHAR(250),	-- the document id #
   event         VARCHAR(512),   -- the code symbolizing the event type
   date_logged   TIMESTAMP,      -- the datetime on which the event occurred
Index: src/upgrade-db-to-1.10.0-oracle.sql
===================================================================
--- src/upgrade-db-to-1.10.0-oracle.sql	(revision 6541)
+++ src/upgrade-db-to-1.10.0-oracle.sql	(revision 6542)
@@ -50,6 +50,11 @@
 */
 ALTER TABLE xml_access ADD COLUMN guid VARCHAR2(2000);
 
+/**
+ * track the user-agent for the request
+ */
+ALTER TABLE acces_log ADD COLUMN user_agent VARCHAR2(512);
+
 /*
  * add the nodedatadate column to xml_nodes 
  * TODO: load the data into it (java?)
@@ -59,7 +64,6 @@
 ALTER TABLE xml_path_index ADD COLUMN nodedatadate TIMESTAMP;
 CREATE INDEX xml_path_index_idx4 ON xml_path_index (nodedatadate);
 
-
 /*
  * Register the DataONE schemas
  */
Index: src/edu/ucsb/nceas/metacat/EventLogData.java
===================================================================
--- src/edu/ucsb/nceas/metacat/EventLogData.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/EventLogData.java	(revision 6542)
@@ -32,6 +32,7 @@
  */
 public class EventLogData {
 	private String ipAddress;
+	private String userAgent;
 	private String principal;
 	private String docid;
 	private String event;
@@ -46,8 +47,7 @@
 	 * @param revision the revision of the document to which the event applies
 	 * @param event the string code for the event
 	 */
-	public EventLogData(String ipAddress, String principal, String docid,
-			String event) {
+	public EventLogData(String ipAddress, String principal, String docid, String event) {
 		this.ipAddress = ipAddress;
 		this.principal = principal;
 		this.docid = docid;
@@ -126,4 +126,12 @@
 	public void setPrincipal(String principal) {
 		this.principal = principal;
 	}
+
+	public String getUserAgent() {
+		return userAgent;
+	}
+
+	public void setUserAgent(String userAgent) {
+		this.userAgent = userAgent;
+	}
 }
Index: src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java	(revision 6542)
@@ -308,7 +308,7 @@
 		} catch (Exception e) {
 			logMetacat.warn("No permission specified");
 		}
-		boolean result = MNodeService.getInstance().isAuthorized(session, pid, permission);
+		boolean result = MNodeService.getInstance(request).isAuthorized(session, pid, permission);
 		response.setStatus(200);
 		response.setContentType("text/xml");
 		return result;
@@ -335,7 +335,7 @@
 			throw new ServiceFailure("2161", e.getMessage());
 		}
 		
-		MNodeService.getInstance().synchronizationFailed(session, syncFailed);
+		MNodeService.getInstance(request).synchronizationFailed(session, syncFailed);
     }
     
 
@@ -364,7 +364,7 @@
         
         if (pathInfo.toLowerCase().equals("ping")) {
             logMetacat.debug("processing ping request");
-            boolean result = MNodeService.getInstance().ping();
+            boolean result = MNodeService.getInstance(request).ping();
             return result;
             
         } else if (pathInfo.toLowerCase().equals("status")) {
@@ -429,7 +429,7 @@
                 event = Event.convert(eventName);
             }
             
-            MonitorList monitorList = MNodeService.getInstance().getOperationStatistics(session, fromDate, toDate, subject, event, fmtid);
+            MonitorList monitorList = MNodeService.getInstance(request).getOperationStatistics(session, fromDate, toDate, subject, event, fmtid);
             
             OutputStream out = response.getOutputStream();
             response.setStatus(200);
@@ -500,7 +500,7 @@
         }
         logMetacat.debug("getting checksum for object " + pid + " with algorithm " + checksumAlgorithm);
         
-        Checksum c = MNodeService.getInstance().getChecksum(session, pidid, checksumAlgorithm);
+        Checksum c = MNodeService.getInstance(request).getChecksum(session, pidid, checksumAlgorithm);
         logMetacat.debug("got checksum " + c.getValue());
         response.setStatus(200);
         logMetacat.debug("serializing response");
@@ -534,7 +534,7 @@
         logMetacat.debug("sourceNode: " + sn);
         NodeReference sourceNode = TypeMarshaller.unmarshalTypeFromStream(NodeReference.class, new ByteArrayInputStream(sn.getBytes("UTF-8")));
         
-        MNodeService.getInstance().replicate(session, sysmeta, sourceNode);
+        MNodeService.getInstance(request).replicate(session, sysmeta, sourceNode);
 
         response.setStatus(200);
 
@@ -553,7 +553,7 @@
     private void node() 
         throws JiBXException, IOException, NotImplemented, NotAuthorized, ServiceFailure, InvalidRequest {
         
-        Node n = MNodeService.getInstance().getCapabilities();
+        Node n = MNodeService.getInstance(request).getCapabilities();
         
         response.setContentType("text/xml");
         response.setStatus(200);
@@ -580,7 +580,7 @@
         Identifier id = new Identifier();
         id.setValue(pid);
 
-        DescribeResponse dr = MNodeService.getInstance().describe(session, id);
+        DescribeResponse dr = MNodeService.getInstance(request).describe(session, id);
         //response.addHeader("pid", pid);
         response.addHeader("DataONE-Checksum", dr.getDataONE_Checksum().getAlgorithm() + "," + dr.getDataONE_Checksum().getValue());
         response.addHeader("Content-Length", dr.getContent_Length() + "");
@@ -644,7 +644,7 @@
 		}
         
         logMetacat.debug("calling getLogRecords");
-        Log log = MNodeService.getInstance().getLogRecords(session, fromDate, toDate, event, start, count);
+        Log log = MNodeService.getInstance(request).getLogRecords(session, fromDate, toDate, event, start, count);
         
         OutputStream out = response.getOutputStream();
         response.setStatus(200);
@@ -673,7 +673,7 @@
             Identifier id = new Identifier();
             id.setValue(pid);
                 
-            SystemMetadata sm = MNodeService.getInstance().getSystemMetadata(session, id);
+            SystemMetadata sm = MNodeService.getInstance(request).getSystemMetadata(session, id);
             
             //set the content type
             if (sm.getFmtid().getValue().trim().equals(
@@ -699,7 +699,7 @@
                 response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".xml");
             }
             
-            InputStream data = MNodeService.getInstance().get(session, id);
+            InputStream data = MNodeService.getInstance(request).get(session, id);
 
             out = response.getOutputStream();  
             IOUtils.copyLarge(data, out);
@@ -783,7 +783,7 @@
           	 
             }
             ObjectList ol = 
-           	 MNodeService.getInstance().listObjects(session, startTime, endTime, 
+           	 MNodeService.getInstance(request).listObjects(session, startTime, endTime, 
                fmtid, replicaStatus, start, count);
            
             out = response.getOutputStream();  
@@ -813,7 +813,7 @@
 
         Identifier id = new Identifier();
         id.setValue(pid);
-        SystemMetadata sysmeta = MNodeService.getInstance().getSystemMetadata(session, id);
+        SystemMetadata sysmeta = MNodeService.getInstance(request).getSystemMetadata(session, id);
         
         response.setContentType("text/xml");
         response.setStatus(200);
@@ -870,7 +870,7 @@
             Identifier id = new Identifier();
             id.setValue(pid);
             logMetacat.debug("creating object with pid " + pid);
-            Identifier rId = MNodeService.getInstance().create(session, id, object, smd);
+            Identifier rId = MNodeService.getInstance(request).create(session, id, object, smd);
             TypeMarshaller.marshalTypeToOutputStream(rId, out);
             
         } else if (action.equals(FUNCTION_NAME_UPDATE)) {
@@ -893,7 +893,7 @@
             // get the systemmetadata object
             SystemMetadata smd = TypeMarshaller.unmarshalTypeFromStream(SystemMetadata.class, sysmeta);
 
-            Identifier rId = MNodeService.getInstance().update(session, obsoletedPid, object, newPid, smd);
+            Identifier rId = MNodeService.getInstance(request).update(session, obsoletedPid, object, newPid, smd);
             TypeMarshaller.marshalTypeToOutputStream(rId, out);
         } else {
             throw new InvalidRequest("1000", "Operation must be create or update.");
@@ -925,7 +925,7 @@
         id.setValue(pid);
 
         logMetacat.debug("Calling delete");
-        MNodeService.getInstance().delete(session, id);
+        MNodeService.getInstance(request).delete(session, id);
         TypeMarshaller.marshalTypeToOutputStream(id, out);
         
     }    
@@ -953,7 +953,7 @@
         id.setValue(pid);
         
         AccessPolicy accessPolicy = collectAccessPolicy();
-        MNodeService.getInstance().setAccessPolicy(session, id, accessPolicy);
+        MNodeService.getInstance(request).setAccessPolicy(session, id, accessPolicy);
         
         
     }
Index: src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java	(revision 6542)
@@ -330,7 +330,7 @@
     	Identifier guidid = new Identifier();
         guidid.setValue(guid);
         logMetacat.debug("getting checksum for object " + guid);
-        Checksum c = CNodeService.getInstance().getChecksum(session, guidid);
+        Checksum c = CNodeService.getInstance(request).getChecksum(session, guidid);
         logMetacat.debug("got checksum " + c.getValue());
         response.setStatus(200);
         logMetacat.debug("serializing response");
@@ -395,7 +395,7 @@
 		}
         
         logMetacat.debug("calling getLogRecords");
-        Log log = CNodeService.getInstance().getLogRecords(session, fromDate, toDate, event, start, count);
+        Log log = CNodeService.getInstance(request).getLogRecords(session, fromDate, toDate, event, start, count);
         
         OutputStream out = response.getOutputStream();
         response.setStatus(200);
@@ -421,7 +421,7 @@
         Identifier id = new Identifier();
         id.setValue(guid);
             
-        SystemMetadata sm = CNodeService.getInstance().getSystemMetadata(session, id);
+        SystemMetadata sm = CNodeService.getInstance(request).getSystemMetadata(session, id);
         
         //set the content type
         if(sm.getFmtid().getValue().trim().equals(
@@ -447,7 +447,7 @@
             response.setHeader("Content-Disposition", "inline; filename=" + id.getValue() + ".xml");
         }
         
-        InputStream data = CNodeService.getInstance().get(session, id);
+        InputStream data = CNodeService.getInstance(request).get(session, id);
         
         OutputStream out = response.getOutputStream();
         response.setStatus(200);
@@ -472,7 +472,7 @@
 
         Identifier id = new Identifier();
         id.setValue(guid);
-        SystemMetadata sysmeta = CNodeService.getInstance().getSystemMetadata(session, id);
+        SystemMetadata sysmeta = CNodeService.getInstance(request).getSystemMetadata(session, id);
         
         response.setContentType("text/xml");
         response.setStatus(200);
@@ -522,7 +522,7 @@
             Identifier id = new Identifier();
             id.setValue(pid);
             logMetacat.debug("creating object with pid " + id.getValue());
-            Identifier rId = CNodeService.getInstance().create(session, id, object, smd);
+            Identifier rId = CNodeService.getInstance(request).create(session, id, object, smd);
             
             OutputStream out = response.getOutputStream();
             response.setStatus(200);
@@ -548,7 +548,7 @@
 	private void listFormats() throws InvalidRequest, ServiceFailure, NotFound, InsufficientResources, NotImplemented, IOException, JiBXException {
       logMetacat.debug("Entering listFormats()");
 
-      ObjectFormatList objectFormatList = CNodeService.getInstance().listFormats();
+      ObjectFormatList objectFormatList = CNodeService.getInstance(request).listFormats();
       // get the response output stream
       OutputStream out = response.getOutputStream();
       response.setStatus(200);
@@ -577,7 +577,7 @@
       fmtid.setValue(fmtidStr);
       
 	  // get the specified object format
-      ObjectFormat objectFormat = CNodeService.getInstance().getFormat(fmtid);
+      ObjectFormat objectFormat = CNodeService.getInstance(request).getFormat(fmtid);
       
       OutputStream out = response.getOutputStream();
       response.setStatus(200);
@@ -621,7 +621,7 @@
 			logMetacat.warn("pid not specified");
 		} 
 		// call the implementation
-		boolean result = CNodeService.getInstance().reserveIdentifier(session, pid);
+		boolean result = CNodeService.getInstance(request).reserveIdentifier(session, pid);
 		OutputStream out = response.getOutputStream();
 		response.setStatus(200);
 		response.setContentType("text/xml");
@@ -643,7 +643,7 @@
     private void resolve(String id) throws InvalidRequest, InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, IOException, JiBXException {
 		Identifier pid = new Identifier();
 		pid.setValue(id);
-		ObjectLocationList locationList = CNodeService.getInstance().resolve(session, pid);
+		ObjectLocationList locationList = CNodeService.getInstance(request).resolve(session, pid);
 	    OutputStream out = response.getOutputStream();
 		response.setStatus(200);
 		response.setContentType("text/xml");
@@ -678,7 +678,7 @@
 		} catch (Exception e) {
 			logMetacat.warn("pidOfObject not specified");
 		}
-		boolean result = CNodeService.getInstance().assertRelation(session, pidOfSubject, relationship, pidOfObject);
+		boolean result = CNodeService.getInstance(request).assertRelation(session, pidOfSubject, relationship, pidOfObject);
 		response.setStatus(200);
 		response.setContentType("text/xml");
 		return result;
@@ -703,7 +703,7 @@
 		pid.setValue(id);
 		String subjectStr = params.get("subject")[0];
 		Subject subject = TypeMarshaller.unmarshalTypeFromStream(Subject.class, new ByteArrayInputStream(subjectStr.getBytes("UTF-8")));
-		Identifier retPid = CNodeService.getInstance().setOwner(session, pid, subject);
+		Identifier retPid = CNodeService.getInstance(request).setOwner(session, pid, subject);
 		OutputStream out = response.getOutputStream();
 		response.setStatus(200);
 		response.setContentType("text/xml");
@@ -725,7 +725,7 @@
 		Identifier pid = new Identifier();
 		pid.setValue(id);
 		String permission = params.get("action")[0];
-		boolean result = CNodeService.getInstance().isAuthorized(session, pid, Permission.convert(permission));
+		boolean result = CNodeService.getInstance(request).isAuthorized(session, pid, Permission.convert(permission));
 		response.setStatus(200);
 		response.setContentType("text/xml");
 		return result;
@@ -754,7 +754,7 @@
 		Identifier guid = new Identifier();
 		guid.setValue(pid);
 		logMetacat.debug("registering system metadata with pid " + guid.getValue());
-		Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, systemMetadata);
+		Identifier retGuid = CNodeService.getInstance(request).registerSystemMetadata(session, guid, systemMetadata);
 		
 		response.setStatus(200);
 		response.setContentType("text/xml");
@@ -783,7 +783,7 @@
         id.setValue(pid);
         
         AccessPolicy accessPolicy = collectAccessPolicy();
-        CNodeService.getInstance().setAccessPolicy(session, id, accessPolicy);
+        CNodeService.getInstance(request).setAccessPolicy(session, id, accessPolicy);
 
     }
     
@@ -814,7 +814,7 @@
 		}
 		
     	// expecting to throw NotImplemented
-		CNodeService.getInstance().search(session, queryType, query);
+		CNodeService.getInstance(request).search(session, queryType, query);
     }
 
 }
Index: src/edu/ucsb/nceas/metacat/MetaCatServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 6542)
@@ -890,7 +890,7 @@
 			} else if (action.equals("insert") || action.equals("update")) {
 				PrintWriter out = response.getWriter();
 				if ((userName != null) && !userName.equals("public")) {
-					handler.handleInsertOrUpdateAction(request.getRemoteAddr(), response, out, params, userName,
+					handler.handleInsertOrUpdateAction(request.getRemoteAddr(), request.getHeader("User-Agent"), response, out, params, userName,
 							groupNames);
 				} else {
 					response.setContentType("text/xml");
Index: src/edu/ucsb/nceas/metacat/EventLog.java
===================================================================
--- src/edu/ucsb/nceas/metacat/EventLog.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/EventLog.java	(revision 6542)
@@ -92,15 +92,13 @@
      * that initiated the event.
      * 
      * @param ipAddress the internet protocol address for the event
+     * @param userAgent the agent making the request
 	 * @param principal the principal for the event (a username, etc)
 	 * @param docid the identifier of the document to which the event applies
 	 * @param event the string code for the event
      */
-    public void log(String ipAddress, String principal, String docid,
-			String event)
-    {
-        EventLogData logData = new EventLogData(ipAddress, principal, docid,
-                event);
+    public void log(String ipAddress, String userAgent, String principal, String docid, String event) {
+        EventLogData logData = new EventLogData(ipAddress, principal, docid, event);
         insertLogEntry(logData);
     }
     
@@ -112,10 +110,11 @@
     private void insertLogEntry(EventLogData logData)
     {
         String insertString = "insert into access_log"
-                + "(ip_address, principal, docid, "
+                + "(ip_address, user_agent, principal, docid, "
                 + "event, date_logged) "
                 + "values ("
                 + "'" + logData.getIpAddress() + "', " 
+                + "'" + logData.getUserAgent() + "', " 
                 + "'" + logData.getPrincipal() + "', "
                 + "'" + logData.getDocid() + "', "
                 + "'" + logData.getEvent() + "', "
@@ -160,7 +159,7 @@
     {
         StringBuffer resultDoc = new StringBuffer();
         StringBuffer query = new StringBuffer();
-        query.append("select entryid, ip_address, principal, docid, "
+        query.append("select entryid, ip_address, user_agent, principal, docid, "
             + "event, date_logged from access_log");
 //                        + ""
 //                        + "event, date_logged) " + "values (" + "'"
@@ -233,10 +232,11 @@
                 		generateXmlRecord(
                 				rs.getString(1), //id
                 				anonymous ? "" : rs.getString(2), //ip
-                				anonymous ? "" : rs.getString(3), //principal
-                                rs.getString(4), 
+                				rs.getString(3), //userAgent	
+                				anonymous ? "" : rs.getString(4), //principal
                                 rs.getString(5), 
-                                rs.getTimestamp(6)));
+                                rs.getString(6), 
+                                rs.getTimestamp(7)));
             }
             resultDoc.append("</log>");
             stmt.close();
@@ -286,6 +286,7 @@
      * 
      * @param entryId the identifier of the log entry
      * @param ipAddress the internet protocol address for the event
+     * @param the agent making the request
 	 * @param principal the principal for the event (a username, etc)
 	 * @param docid the identifier of the document to which the event applies
 	 * @param event the string code for the event
@@ -292,7 +293,7 @@
      * @param dateLogged the date on which the event occurred
      * @return String containing the formatted XML
      */
-    private String generateXmlRecord(String entryId, String ipAddress, 
+    private String generateXmlRecord(String entryId, String ipAddress, String userAgent,
             String principal, String docid, String event, Timestamp dateLogged)
     {
         StringBuffer rec = new StringBuffer();
@@ -299,6 +300,7 @@
         rec.append("<logEntry>");
         rec.append(generateXmlElement("entryid", entryId));
         rec.append(generateXmlElement("ipAddress", ipAddress));
+        rec.append(generateXmlElement("userAgent", userAgent));
         rec.append(generateXmlElement("principal", principal));
         rec.append(generateXmlElement("docid", docid));
         rec.append(generateXmlElement("event", event));
Index: src/edu/ucsb/nceas/metacat/MetacatHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/MetacatHandler.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/MetacatHandler.java	(revision 6542)
@@ -719,7 +719,7 @@
             }
             out.close();
             
-            EventLog.getInstance().log(request.getRemoteAddr(), user,
+            EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), user,
                     inlineDataId, "readinlinedata");
         } catch (Exception e) {
             try {
@@ -818,7 +818,7 @@
                         if (zip) {
                             addDocToZip(request, docid, providedFileName, zout, user, groups);
                         } else {
-                            readFromMetacat(request.getRemoteAddr(), response, response.getOutputStream(), docid, qformat,
+                            readFromMetacat(request.getRemoteAddr(), request.getHeader("User-Agent"), response, response.getOutputStream(), docid, qformat,
                                     user, groups, withInlineData, params);
                         }
                         
@@ -840,7 +840,7 @@
                     	if (out == null) {
                     		out = response.getOutputStream();
                     	}
-                        readFromMetacat(request.getRemoteAddr(), response, out, docid, qformat,
+                        readFromMetacat(request.getRemoteAddr(), request.getHeader("User-Agent"), response, out, docid, qformat,
                                 user, groups, withInlineData, params);
                     }
                 }
@@ -1171,7 +1171,7 @@
       try {
           
         DocumentImpl.delete(docid, user, groups, null); // null: don't notify server
-        EventLog.getInstance().log(request.getRemoteAddr(),
+        EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"),
                 user, docid, "delete");
         response.setContentType("text/xml");
         out.println(this.PROLOG);
@@ -1251,11 +1251,12 @@
     }
     
     /** read metadata or data from Metacat
+     * @param userAgent 
      * @throws PropertyNotFoundException 
      * @throws ParseLSIDException 
      * @throws InsufficientKarmaException 
      */
-    public void readFromMetacat(String ipAddress,
+    public void readFromMetacat(String ipAddress, String userAgent,
             HttpServletResponse response, OutputStream out, String docid, String qformat,
             String user, String[] groups, boolean withInlineData, 
             Hashtable<String, String[]> params) throws ClassNotFoundException, 
@@ -1400,7 +1401,7 @@
                 }
                 
             }
-            EventLog.getInstance().log(ipAddress, user, docid, "read");
+            EventLog.getInstance().log(ipAddress, userAgent, user, docid, "read");
         } catch (PropertyNotFoundException except) {
             throw except;
         }
@@ -1607,7 +1608,7 @@
                     zout.write(bytestring, 0, bytestring.length);
                     zout.closeEntry();
                 }
-                EventLog.getInstance().log(request.getRemoteAddr(), user,
+                EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), user,
                         docid, "read");
             } catch (Exception except) {
                 throw except;
@@ -1648,8 +1649,9 @@
     /**
      * Handle the database putdocument request and write an XML document to the
      * database connection
+     * @param userAgent 
      */
-    public String handleInsertOrUpdateAction(String ipAddress,
+    public String handleInsertOrUpdateAction(String ipAddress, String userAgent,
             HttpServletResponse response, PrintWriter out, Hashtable<String, String[]> params,
             String user, String[] groups) {
         Logger logMetacat = Logger.getLogger(MetacatHandler.class);
@@ -1817,13 +1819,13 @@
                 		          "writing with null acnumber");
                   newdocid = documentWrapper.write(dbConn, doctext[0], pub, dtd,
                           doAction, null, user, groups);
-                  EventLog.getInstance().log(ipAddress, user, "", action[0]);
+                  EventLog.getInstance().log(ipAddress, userAgent, user, "", action[0]);
               
               } else {
                   newdocid = documentWrapper.write(dbConn, doctext[0], pub, dtd,
                           doAction, accNumber, user, groups);
             
-                  EventLog.getInstance().log(ipAddress, user, accNumber, action[0]);
+                  EventLog.getInstance().log(ipAddress, userAgent, user, accNumber, action[0]);
               
               }
               
@@ -2890,7 +2892,7 @@
                 doctextArr[0] = doctext;
                 params.put("doctext", doctextArr);
                 //call the insert routine
-                handleInsertOrUpdateAction(request.getRemoteAddr(), response, out, 
+                handleInsertOrUpdateAction(request.getRemoteAddr(), request.getHeader("User-Agent"), response, out, 
                           params, username, groupnames);
               }
               catch(Exception e)
@@ -3027,7 +3029,7 @@
                             throw ee;
                         }
 
-                        EventLog.getInstance().log(request.getRemoteAddr(),
+                        EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"),
                                 username, docid, "upload");
                         // Force replication this data file
                         // To data file, "insert" and update is same
Index: src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/MNodeService.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/dataone/MNodeService.java	(revision 6542)
@@ -32,6 +32,8 @@
 import java.util.List;
 import java.util.Timer;
 
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.commons.io.IOUtils;
 import org.apache.log4j.Logger;
 import org.dataone.client.CNode;
@@ -90,6 +92,7 @@
 import edu.ucsb.nceas.metacat.database.DBConnection;
 import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.properties.PropertyService;
+import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
 /**
@@ -121,9 +124,6 @@
  */
 public class MNodeService extends D1NodeService implements MNAuthorization, MNCore, MNRead, MNReplication, MNStorage {
 
-    /* the instance of the MNodeService object */
-    private static MNodeService instance = null;
-
     /* the logger instance */
     private Logger logMetacat = null;
 
@@ -132,18 +132,15 @@
      * 
      * @return instance - the instance of MNodeService
      */
-    public static MNodeService getInstance() {
-        if (instance == null) {
-            instance = new MNodeService();
-        }
-        return instance;
+    public static MNodeService getInstance(HttpServletRequest request) {
+        return new MNodeService(request);
     }
 
     /**
      * Constructor, private for singleton access
      */
-    private MNodeService() {
-        super();
+    private MNodeService(HttpServletRequest request) {
+        super(request);
         logMetacat = Logger.getLogger(MNodeService.class);
     }
 
@@ -203,7 +200,7 @@
             try {
                 // delete the document
                 DocumentImpl.delete(localId, username, groupnames, null);
-                EventLog.getInstance().log(metacatUrl, username, localId, Event.DELETE.xmlValue());
+                EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), username, localId, Event.DELETE.xmlValue());
 
             } catch (McdbDocNotFoundException e) {
                 throw new InvalidRequest("1322", "The provided identifier was invalid.");
@@ -336,7 +333,7 @@
             insertSystemMetadata(sysmeta);
 
             // log the update event
-            EventLog.getInstance().log(metacatUrl, subject.getValue(), localId, "update");
+            EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), subject.getValue(), localId, Event.UPDATE.toString());
 
         } else {
             throw new NotAuthorized("1200", "The provided identity does not have " + "permission to UPDATE the object identified by " + pid.getValue()
@@ -668,8 +665,9 @@
 
             // Set the properties of the node based on configuration information and
             // calls to current status methods
+            String serviceName = SystemUtil.getContextURL() + "/" + PropertyService.getProperty("dataone.serviceName");
             Node node = new Node();
-            node.setBaseURL(metacatUrl + "/" + nodeTypeString);
+            node.setBaseURL(serviceName + "/" + nodeTypeString);
             node.setDescription(nodeDesc);
 
             // set the node's health information
@@ -884,7 +882,7 @@
         	principal = session.getSubject().getValue();
         }
         try {
-        	EventLog.getInstance().log(syncFailed.getNodeId(), principal, localId, "synchronization_failed");
+        	EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), principal, localId, "synchronization_failed");
         } catch (Exception e) {
             throw new ServiceFailure("2161", "Could not log the error for: " + syncFailed.getPid());
 		}
@@ -943,7 +941,7 @@
         if (session.getSubject() != null) {
             principal = session.getSubject().getValue();
         }
-        EventLog.getInstance().log(null, principal, localId, "getreplica");
+        EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), principal, localId, "getreplica");
 
         return inputStream;
     }
Index: src/edu/ucsb/nceas/metacat/dataone/CNodeService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/CNodeService.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/dataone/CNodeService.java	(revision 6542)
@@ -27,6 +27,8 @@
 import java.util.List;
 import java.util.Set;
 
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.log4j.Logger;
 import org.dataone.client.CNode;
 import org.dataone.client.D1Client;
@@ -78,9 +80,6 @@
 public class CNodeService extends D1NodeService implements CNAuthorization,
     CNCore, CNRead, CNReplication {
 
-  /* the instance of the CNodeService object */
-  private static CNodeService instance = null;
-
   /* the logger instance */
   private Logger logMetacat = null;
 
@@ -87,21 +86,15 @@
   /**
    * singleton accessor
    */
-  public static CNodeService getInstance() { 
-    if (instance == null) {
-    
-      instance = new CNodeService();
-      
-    }
-  
-    return instance;
+  public static CNodeService getInstance(HttpServletRequest request) { 
+    return new CNodeService(request);
   }
   
   /**
    * Constructor, private for singleton access
    */
-  private CNodeService() {
-    super();
+  private CNodeService(HttpServletRequest request) {
+    super(request);
     logMetacat = Logger.getLogger(CNodeService.class);
         
   }
@@ -559,7 +552,7 @@
         }
         
         logMetacat.debug("Returning from registerSystemMetadata");
-        EventLog.getInstance().log(null, session.getSubject().getValue(), guid.getValue(), "registerSystemMetadata");
+        EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), session.getSubject().getValue(), guid.getValue(), "registerSystemMetadata");
         return guid;
   }
 
@@ -625,7 +618,7 @@
     	}
         
         logMetacat.debug("Returning from updateSystemMetadata");
-        EventLog.getInstance().log(null, session.getSubject().getValue(), guid.getValue(), "updateSystemMetadata");
+        EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), session.getSubject().getValue(), guid.getValue(), "updateSystemMetadata");
         return true;
   }
   
Index: src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java	(revision 6542)
@@ -38,7 +38,9 @@
 import java.util.Timer;
 import java.util.Vector;
 
+import javax.servlet.http.HttpServletRequest;
 
+
 import org.apache.commons.io.IOUtils;
 import org.apache.log4j.Logger;
 import org.dataone.client.ObjectFormatCache;
@@ -87,8 +89,8 @@
   
   private static Logger logMetacat = Logger.getLogger(D1NodeService.class);
 
-  /* the metacat URL as a string (including ending /d1 service)*/
-  protected String metacatUrl;
+  /** For logging the operations */
+  protected HttpServletRequest request;
   
   /* reference to the metacat handler */
   protected MetacatHandler handler;
@@ -101,19 +103,9 @@
    * 
    * @param metacatUrl - the URL of the metacat service, including the ending /d1
    */
-  public D1NodeService() {
-  	this.metacatUrl = "";
-  	
-    try {
-	    this.metacatUrl = SystemUtil.getContextURL() + "/" +
-	    PropertyService.getProperty("dataone.serviceName");
-    } catch (PropertyNotFoundException e) {
-      throw new RuntimeException("Error getting the servlet url in D1NodeService: " + 
-        	e.getMessage());
-
-    }
-    
-  }
+  public D1NodeService(HttpServletRequest request) {
+		this.request = request;
+	}
   
   /**
    * Adds a new object to the Node, where the object is either a data 
@@ -351,6 +343,7 @@
       String entryId = getLogEntryField("entryid", entry);
       String ipAddress = getLogEntryField("ipAddress", entry);
       String principal = getLogEntryField("principal", entry);
+      String userAgent = getLogEntryField("userAgent", entry);
       String docid = getLogEntryField("docid", entry);
       String eventS = getLogEntryField("event", entry);
       String dateLogged = getLogEntryField("dateLogged", entry);
@@ -401,7 +394,7 @@
       Subject princ = new Subject();
       princ.setValue(principal);
       le.setSubject(princ);
-      le.setUserAgent("metacat/RESTService");
+      le.setUserAgent(userAgent);
 
       // event filtering?
       if (event == null) {
@@ -492,7 +485,7 @@
     if (session != null && session.getSubject() != null) {
     	principal = session.getSubject().getValue();
     }
-    EventLog.getInstance().log(null, principal, localId, "read");
+    EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), principal, localId, "read");
     
     return inputStream;
   }
@@ -836,7 +829,7 @@
     
     // do the insert or update action
     handler = new MetacatHandler(new Timer());
-    String result = handler.handleInsertOrUpdateAction(metacatUrl, null, 
+    String result = handler.handleInsertOrUpdateAction(request.getRemoteAddr(), request.getHeader("User-Agent"), null, 
                         null, params, username, groupnames);
     
     if(result.indexOf("<error>") != -1) {
@@ -938,7 +931,7 @@
           }
   
           logMetacat.debug("Logging the creation event.");
-          EventLog.getInstance().log(metacatUrl, username, localId, "create");
+          EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), username, localId, "create");
   
           // Schedule replication for this data file
           logMetacat.debug("Scheduling replication.");
Index: src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java	(revision 6542)
@@ -357,7 +357,7 @@
         CNode cn;
         try {
             logMetacat.debug("Get the Node description.");
-            Node node = MNodeService.getInstance().getCapabilities();
+            Node node = MNodeService.getInstance(null).getCapabilities();
             logMetacat.debug("Setting client certificate location.");
             String certificatePath = PropertyService.getProperty("dataone.certpath");
             if (!certificatePath.endsWith(File.separator)) {
Index: src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java	(revision 6542)
@@ -475,7 +475,7 @@
           REVINSERTNUMBER++;
       }
       String ip = getIpFromURL(u);
-      EventLog.getInstance().log(ip, ReplicationService.REPLICATIONUSER, accNumber, actions);
+      EventLog.getInstance().log(ip, null, ReplicationService.REPLICATIONUSER, accNumber, actions);
       
 
     }//try
@@ -627,7 +627,7 @@
             REVINSERTNUMBER++;
         }
         String ip = getIpFromURL(u);
-        EventLog.getInstance().log(ip, ReplicationService.REPLICATIONUSER, accNumber, actions);
+        EventLog.getInstance().log(ip, null, ReplicationService.REPLICATIONUSER, accNumber, actions);
         
       }//if
       else
@@ -697,7 +697,7 @@
          logReplication.info("ReplicationHandler.handleDeleteSingleDocument - Doc " + docId + " deleted");
          URL u = new URL("https://"+notifyServer);
          String ip = getIpFromURL(u);
-         EventLog.getInstance().log(ip, ReplicationService.REPLICATIONUSER, docId, "delete");
+         EventLog.getInstance().log(ip, null, ReplicationService.REPLICATIONUSER, docId, "delete");
       }
 
     }//try
@@ -840,7 +840,7 @@
 							+ guid);
 
 			String ip = getIpFromURL(sysMetaUrl);
-			EventLog.getInstance().log(ip, ReplicationService.REPLICATIONUSER, guid, "systemMetadata");
+			EventLog.getInstance().log(ip, null, ReplicationService.REPLICATIONUSER, guid, "systemMetadata");
 
 		} catch (Exception e) {
 			logMetacat.error("ReplicationHandler.handleSystemMetadata - "
Index: src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/replication/ReplicationService.java	(revision 6541)
+++ src/edu/ucsb/nceas/metacat/replication/ReplicationService.java	(revision 6542)
@@ -655,7 +655,7 @@
 				logReplication.info("ReplicationService.handleForceReplicateRequest - document " + docid + " added to DB with "
 						+ "action " + dbaction);
 				
-				EventLog.getInstance().log(request.getRemoteAddr(), REPLICATIONUSER, docid, dbaction);
+				EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), REPLICATIONUSER, docid, dbaction);
 			}
 		} catch (SQLException sqle) {
 			logMetacat.error("ReplicationService.handleForceReplicateRequest - " + ReplicationService.METACAT_REPL_ERROR_MSG);                         
@@ -711,7 +711,7 @@
 			logReplication.info("ReplicationService.handleForceReplicateDeleteRequest - Force replication delete docid: " + docid);
 			DocumentImpl.delete(docid, null, null, server);
 			logReplication.info("ReplicationService.handleForceReplicateDeleteRequest - document " + docid + " was successfully deleted ");
-			EventLog.getInstance().log(request.getRemoteAddr(), REPLICATIONUSER, docid,
+			EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), REPLICATIONUSER, docid,
 					"delete");
 			logReplication.info("ReplicationService.handleForceReplicateDeleteRequest - document " + docid + " was successfully deleted ");
 		} catch (McdbDocNotFoundException e) {
@@ -867,7 +867,7 @@
 
 				logReplication.info("ReplicationService.handleForceReplicateDataFileRequest - datafile " + docid + " added to DB with "
 						+ "action " + dbaction);
-				EventLog.getInstance().log(request.getRemoteAddr(), REPLICATIONUSER,
+				EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), REPLICATIONUSER,
 						docid, dbaction);
 			}
 
@@ -1064,7 +1064,7 @@
 			}
       
 			logReplication.info("ReplicationService.handleForceReplicateSystemMetadataRequest - processed guid: " + guid);
-			EventLog.getInstance().log(request.getRemoteAddr(), REPLICATIONUSER, guid, "systemMetadata");
+			EventLog.getInstance().log(request.getRemoteAddr(), request.getHeader("User-Agent"), REPLICATIONUSER, guid, "systemMetadata");
 
 		} catch (Exception e) {
 			logMetacat.error("ReplicationService.handleForceReplicateRequest - " + ReplicationService.METACAT_REPL_ERROR_MSG, e);                         
