Index: src/edu/ucsb/nceas/metacat/MetaCatServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 4779)
+++ src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 4780)
@@ -1117,9 +1117,10 @@
         try {
             sess = new AuthSession();
         } catch (Exception e) {
-            System.out.println("error in MetacatServlet.handleLoginAction: "
-                    + e.getMessage());
-            out.println(e.getMessage());
+        	String errorMsg = "Problem in MetacatServlet.handleLoginAction() authenicating session: "
+                + e.getMessage();
+            logMetacat.error(errorMsg);
+            out.println(errorMsg);
             return;
         }
         boolean isValid = sess.authenticate(request, un, pw);
@@ -1128,13 +1129,21 @@
         if (isValid) {
             HttpSession session = sess.getSessions();
             String id = session.getId();
-            logMetacat.info("Store session id " + id
+            logMetacat.debug("Store session id " + id
                     + " which has username" + session.getAttribute("username")
                     + " into hash in login method");
-            SessionService.registerSession(id, 
-					(String) session.getAttribute("username"), 
-					(String[]) session.getAttribute("groupnames"),
-					(String) session.getAttribute("password"));
+            try {
+				SessionService.registerSession(id, (String) session
+						.getAttribute("username"), (String[]) session
+						.getAttribute("groupnames"), (String) session
+						.getAttribute("password"));
+			} catch (ServiceException se) {
+				String errorMsg = "Problem in MetacatServlet.handleLoginAction() registering session: "
+						+ se.getMessage();
+				logMetacat.error(errorMsg);
+				out.println(errorMsg);
+				return;
+			}
         }
         
         // format and transform the output
@@ -1148,10 +1157,8 @@
                 trans.transformXMLDocument(sess.getMessage(),
                         "-//NCEAS//login//EN", "-//W3C//HTML//EN", qformat,
                         out, null);
-            } catch (Exception e) {
-                
-                logMetacat.error(
-                        "Error in MetaCatServlet.handleLoginAction: "
+            } catch (Exception e) {               
+                logMetacat.error("Error in MetaCatServlet.handleLoginAction: "
                         + e.getMessage());
             }
         }
Index: src/edu/ucsb/nceas/metacat/service/SessionService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/SessionService.java	(revision 4779)
+++ src/edu/ucsb/nceas/metacat/service/SessionService.java	(revision 4780)
@@ -44,8 +44,9 @@
 	/**
 	 * private constructor since this is a singleton
 	 */
-	private SessionService() {
+	private SessionService() throws ServiceException {
 		sessionHash = new Hashtable<String, SessionData>();
+		logMetacat.debug("Registering public session id: " + PUBLIC_SESSION_ID);
 		registerSession(PUBLIC_SESSION_ID, "public", null, null);
 	}
 	
@@ -54,7 +55,7 @@
 	 * 
 	 * @return the single instance of SessionService
 	 */
-	public static SessionService getInstance() {
+	public static SessionService getInstance() throws ServiceException {
 		if (sessionService == null) {
 			sessionService = new SessionService();
 		}
@@ -83,7 +84,11 @@
 	 *            the password for the session
 	 */
 	public static void registerSession(String sessionId, String userName,
-			String[] groupNames, String password) {
+			String[] groupNames, String password) throws ServiceException {
+		if (sessionId == null) {
+			throw new ServiceException("Cannot register a null session id");
+		}
+		logMetacat.debug("Registering session id: " + sessionId);
 		SessionData sessionData = new SessionData(sessionId, userName, groupNames,
 				password);
 		sessionHash.put(sessionId, sessionData);
@@ -95,7 +100,11 @@
 	 * @param sessionData
 	 *            the session data object to add to the session hash
 	 */
-	public static void registerSession(SessionData sessionData) {
+	public static void registerSession(SessionData sessionData) throws ServiceException {
+		if (sessionData == null) {
+			throw new ServiceException("Cannot register null session data");
+		}
+		logMetacat.debug("Registering session date with id: " + sessionData.getId());
 		sessionHash.put(sessionData.getId(), sessionData);
 	}
 	
@@ -106,7 +115,10 @@
 	 *            the id of the session to remove.
 	 */
 	public static void unRegisterSession(String sessionId) {
-		sessionHash.remove(sessionId);
+		if (sessionId != null) {
+			logMetacat.error("trying to unregister a session with null id");
+			sessionHash.remove(sessionId);
+		}
 	}
 	
 	/**
@@ -117,6 +129,10 @@
 	 *            the id of the session to look for.
 	 */
 	public static boolean isSessionRegistered(String sessionId) {
+		if (sessionId == null) {
+			logMetacat.error("trying to check if a session with null id is registered");
+			return false;
+		}
 		return sessionHash.containsKey(sessionId);
 	}
 	
@@ -128,6 +144,10 @@
 	 *            the id of the session to retrieve.
 	 */
 	public static SessionData getRegisteredSession(String sessionId) {
+		if (sessionId == null) {
+			logMetacat.error("trying to get a session with null id");
+			return null;
+		}
 		return sessionHash.get(sessionId);
 	}
 	
@@ -145,7 +165,9 @@
 	 *            the id of the session to update.
 	 */
 	public static synchronized void touchSession(String sessionId) {
-		if (sessionId != null && isSessionRegistered(sessionId)) {
+		if (sessionId == null) {
+			logMetacat.error("trying to touch a session with null id");
+		} else if (isSessionRegistered(sessionId)) {
 			SessionData sessionData = getRegisteredSession(sessionId);
 			sessionData.setLastAccessedTime();
 		}
Index: src/edu/ucsb/nceas/metacat/util/AuthUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/AuthUtil.java	(revision 4779)
+++ src/edu/ucsb/nceas/metacat/util/AuthUtil.java	(revision 4780)
@@ -34,6 +34,7 @@
 
 import edu.ucsb.nceas.metacat.AuthSession;
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.service.ServiceException;
 import edu.ucsb.nceas.metacat.service.SessionService;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.StringUtil;
@@ -194,10 +195,15 @@
 		// global session list.
 		HttpSession session = authSession.getSessions();
 		String sessionId = session.getId();
+		
+		try {
 		SessionService.registerSession(sessionId, 
 				(String) session.getAttribute("username"), 
 				(String[]) session.getAttribute("groupnames"),
 				(String) session.getAttribute("password"));
+		} catch (ServiceException se) {
+			throw new UtilException("Problem registering session: " + se.getMessage());
+		}
 		
 		return true;
 	}
Index: src/edu/ucsb/nceas/metacat/util/MetacatUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/MetacatUtil.java	(revision 4779)
+++ src/edu/ucsb/nceas/metacat/util/MetacatUtil.java	(revision 4780)
@@ -823,11 +823,11 @@
                 logMetacat.error("Uploaded file '" + fileName + "'is empty!");
             }
         } catch (IOException e) {
-            logMetacat.error("IO exception which writing temporary file: " +
+            logMetacat.error("MetacatUtil.writeTempFile() - IO exception when writing temporary file: " +
                              tempFilePath + " " + e.getMessage());
         }
 
-        logMetacat.info("Temporary file is: " + tempFilePath);
+        logMetacat.debug("Temporary file is: " + tempFilePath);
 
         return tempFilePath;
     }
