https://issues.shibboleth.net/jira/browse/SSPCPP-103
[shibboleth/cpp-sp.git] / shib-target / MemoryListener.cpp
index 44a20af..0bb6a33 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2005 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include "internal.h"
 
 using namespace std;
-using namespace log4cpp;
 using namespace saml;
 using namespace shibboleth;
 using namespace shibtarget;
+using namespace shibtarget::logging;
 
 namespace {
     class MemoryListener : public virtual IListener
@@ -219,7 +219,6 @@ void MemoryListener::sessionNew(
 #endif
 
     // It passes all our tests -- create a new session.
-    log->info("creating new session");
 
     // Are attributes present?
     bool attributesPushed=false;
@@ -233,7 +232,11 @@ void MemoryListener::sessionNew(
     }
 
     auto_ptr_char oname(role->getEntityDescriptor()->getId());
-    auto_ptr_char hname(bpr.authnStatement->getSubject()->getNameIdentifier()->getName());
+    auto_ptr_char hname(
+        bpr.authnStatement->getSubject()->getNameIdentifier() ?
+            bpr.authnStatement->getSubject()->getNameIdentifier()->getName()
+                : NULL
+        );
 
     try {
         // Create a new session key.
@@ -287,7 +290,7 @@ void MemoryListener::sessionNew(
         ") at (ClientAddress: " <<
             ip <<
         ") with (NameIdentifier: " <<
-            hname.get() <<
+            (hname.get() ? hname.get() : "none") <<
         ")";
 
     stc.releaseTransactionLog();