Author: markt
Date: Fri Dec 19 14:55:05 2014
New Revision: 1646760
URL: http://svn.apache.org/r1646760
Log:
Debug logging improvements
Modified:
tomcat/tc8.0.x/trunk/ (props changed)
tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/LocalStrings.properties
tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
Propchange: tomcat/tc8.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 19 14:55:05 2014
@@ -1 +1 @@
-/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640083-1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642233,1642280,1642554,1642564,1642595,1642606,1642668,1642679,1642697,1642699,1642766,1643002,1643045,1643054-1643055,1643066,1643121,1643128,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366,1643370-1643371,1643465,1643474,1643536,1643570,1643634,1643649,1643651,1643654,1643675,1643731,1643733-1643734,1643761,1643766,1643814,1643937,1643963,1644017,1644169,1644201-1644203,1644321,1644323,1644516,1644523,1644529,1644535,1644730,1644768,1644784-1644785,1644790,1644793,1644815,1644884,1644886,1644890,1644892
,1644910,1644924,1644929-1644930,1644935,1644989,1645011,1645247,1645355,1645357-1645358,1645455,1645465,1645469,1645471,1645473,1645475,1645486-1645488,1645626,1645641,1645685,1645743,1645763,1645951-1645953,1645955,1646098-1646106,1646178,1646220,1646302,1646304,1646420,1646470-1646471,1646476,1646559,1646717-1646722
+/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640083-1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642233,1642280,1642554,1642564,1642595,1642606,1642668,1642679,1642697,1642699,1642766,1643002,1643045,1643054-1643055,1643066,1643121,1643128,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309-1643310,1643323,1643365-1643366,1643370-1643371,1643465,1643474,1643536,1643570,1643634,1643649,1643651,1643654,1643675,1643731,1643733-1643734,1643761,1643766,1643814,1643937,1643963,1644017,1644169,1644201-1644203,1644321,1644323,1644516,1644523,1644529,1644535,1644730,1644768,1644784-1644785,1644790,1644793,1644815,1644884,1644886,1644890,1644892
,1644910,1644924,1644929-1644930,1644935,1644989,1645011,1645247,1645355,1645357-1645358,1645455,1645465,1645469,1645471,1645473,1645475,1645486-1645488,1645626,1645641,1645685,1645743,1645763,1645951-1645953,1645955,1646098-1646106,1646178,1646220,1646302,1646304,1646420,1646470-1646471,1646476,1646559,1646717-1646723
Modified:
tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/LocalStrings.properties?rev=1646760&r1=1646759&r2=1646760&view=diff
==============================================================================
---
tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/LocalStrings.properties
(original)
+++
tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/LocalStrings.properties
Fri Dec 19 14:55:05 2014
@@ -31,6 +31,23 @@ formAuthenticator.forwardLoginFail=Unexp
formAuthenticator.noErrorPage=No error page was defined for FORM
authentication in context [{0}]
formAuthenticator.noLoginPage=No login page was defined for FORM
authentication in context [{0}]
+singleSignOn.debug.associate=SSO associating application session [{1}] with
SSO session [{0}]
+singleSignOn.debug.associateFailed=SSO failed to associate application session
[{0}] since SSO session [{1}] does not exist
+singleSignOn.debug.cookieCheck=SSO checking for SSO cookie
+singleSignOn.debug.cookieNotFound=SSO did not find an SSO cookie
+singleSignOn.debug.deregister=SSO expiring application session [{0}]
associated with SSO session [{1}]
+singleSignOn.debug.deregisterFail=SSO failed to deregister the SSO session
[{0}] because it was not in the cache
+singleSignOn.debug.deregisterNone=SSO deregistered the SSO session [{0}] but
found no associated application sessions
+singleSignOn.debug.hasPrincipal=SSO found previously authenticated Principal
[{0}]
+singleSignOn.debug.invoke=SSO processing request for [{0}]
+singleSignOn.debug.principalCheck=SSO looking for a cached Principal for SSO
session [{0}]
+singleSignOn.debug.principalFound=SSO found cached Principal [{0}] with
authentication type [{1}]
+singleSignOn.debug.principalNotFound=SSO did not find a cached Principal.
Erasing SSO cookie for session [{0}]
+singleSignOn.debug.register=SSO registering SSO session [{0}] for user [{1}]
with authentication type [{2}]
+singleSignOn.debug.removeSession=SSO removing application session [{0}] from
SSO session [{1}]
+singleSignOn.debug.sessionLogout=SSO processing a log out for SSO session
[{0}] and application session [{1}]
+singleSignOn.debug.sessionTimeout=SSO processing a time out for SSO session
[{0}] and application session [{1}]
+singleSignOn.debug.update=SSO updating SSO session [{0}] to authentication
type [{1}]
singleSignOn.sessionExpire.engineNull=SSO unable to expire session [{0}]
because the Engine was null
singleSignOn.sessionExpire.hostNotFound=SSO unable to expire session [{0}]
because the Host could not be found
singleSignOn.sessionExpire.contextNotFound=SSO unable to expire session [{0}]
because the Context could not be found
Modified:
tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java?rev=1646760&r1=1646759&r2=1646760&view=diff
==============================================================================
---
tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
(original)
+++
tomcat/tc8.0.x/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
Fri Dec 19 14:55:05 2014
@@ -19,6 +19,7 @@ package org.apache.catalina.authenticato
import java.io.IOException;
import java.security.Principal;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import javax.servlet.ServletException;
@@ -207,12 +208,12 @@ public class SingleSignOn extends ValveB
// Has a valid user already been authenticated?
if (containerLog.isDebugEnabled()) {
- containerLog.debug("Process request for '" +
request.getRequestURI() + "'");
+ containerLog.debug(sm.getString("singleSignOn.debug.invoke",
request.getRequestURI()));
}
if (request.getUserPrincipal() != null) {
if (containerLog.isDebugEnabled()) {
- containerLog.debug(" Principal '" +
request.getUserPrincipal().getName() +
- "' has already been authenticated");
+
containerLog.debug(sm.getString("singleSignOn.debug.hasPrincipal",
+ request.getUserPrincipal().getName()));
}
getNext().invoke(request, response);
return;
@@ -220,7 +221,7 @@ public class SingleSignOn extends ValveB
// Check for the single sign on cookie
if (containerLog.isDebugEnabled()) {
- containerLog.debug(" Checking for SSO cookie");
+ containerLog.debug(sm.getString("singleSignOn.debug.cookieCheck"));
}
Cookie cookie = null;
Cookie cookies[] = request.getCookies();
@@ -234,7 +235,7 @@ public class SingleSignOn extends ValveB
}
if (cookie == null) {
if (containerLog.isDebugEnabled()) {
- containerLog.debug(" SSO cookie is not present");
+
containerLog.debug(sm.getString("singleSignOn.debug.cookieNotFound"));
}
getNext().invoke(request, response);
return;
@@ -242,14 +243,15 @@ public class SingleSignOn extends ValveB
// Look up the cached Principal associated with this cookie value
if (containerLog.isDebugEnabled()) {
- containerLog.debug(" Checking for cached principal for " +
cookie.getValue());
+
containerLog.debug(sm.getString("singleSignOn.debug.principalCheck",
+ cookie.getValue()));
}
SingleSignOnEntry entry = cache.get(cookie.getValue());
if (entry != null) {
if (containerLog.isDebugEnabled()) {
- containerLog.debug(" Found cached principal '" +
- (entry.getPrincipal() != null ?
entry.getPrincipal().getName() : "") + "' with auth type '" +
- entry.getAuthType() + "'");
+
containerLog.debug(sm.getString("singleSignOn.debug.principalFound",
+ entry.getPrincipal() != null ?
entry.getPrincipal().getName() : "",
+ entry.getAuthType()));
}
request.setNote(Constants.REQ_SSOID_NOTE, cookie.getValue());
// Only set security elements if reauthentication is not required
@@ -259,7 +261,8 @@ public class SingleSignOn extends ValveB
}
} else {
if (containerLog.isDebugEnabled()) {
- containerLog.debug(" No cached principal found, erasing SSO
cookie");
+
containerLog.debug(sm.getString("singleSignOn.debug.principalNotFound",
+ cookie.getValue()));
}
// No need to return a valid SSO session ID
cookie.setValue("REMOVE");
@@ -306,10 +309,6 @@ public class SingleSignOn extends ValveB
return;
}
- if (containerLog.isDebugEnabled()) {
- containerLog.debug("Process session destroyed on " + session);
- }
-
// Was the session destroyed as the result of a timeout or context
stop?
// If so, we'll just remove the expired session from the SSO. If the
// session was logged out, we'll log out of all session associated with
@@ -318,11 +317,19 @@ public class SingleSignOn extends ValveB
&& (System.currentTimeMillis() -
session.getThisAccessedTimeInternal() >=
session.getMaxInactiveInterval() * 1000))
|| (!session.getManager().getContext().getState().isAvailable())) {
+ if (containerLog.isDebugEnabled()) {
+
containerLog.debug(sm.getString("singleSignOn.debug.sessionTimeout",
+ ssoId, session));
+ }
removeSession(ssoId, session);
} else {
// The session was logged out.
// Deregister this single session id, invalidating
// associated sessions
+ if (containerLog.isDebugEnabled()) {
+
containerLog.debug(sm.getString("singleSignOn.debug.sessionLogout",
+ ssoId, session));
+ }
deregister(ssoId);
}
}
@@ -339,15 +346,18 @@ public class SingleSignOn extends ValveB
* session, otherwise <code>false</code>
*/
protected boolean associate(String ssoId, Session session) {
-
- if (containerLog.isDebugEnabled()) {
- containerLog.debug("Associate sso id " + ssoId + " with session "
+ session);
- }
-
SingleSignOnEntry sso = cache.get(ssoId);
if (sso == null) {
+ if (containerLog.isDebugEnabled()) {
+
containerLog.debug(sm.getString("singleSignOn.debug.associateFail",
+ ssoId, session));
+ }
return false;
} else {
+ if (containerLog.isDebugEnabled()) {
+ containerLog.debug(sm.getString("singleSignOn.debug.associate",
+ ssoId, session));
+ }
sso.addSession(this, ssoId, session);
return true;
}
@@ -362,21 +372,26 @@ public class SingleSignOn extends ValveB
*/
protected void deregister(String ssoId) {
- if (containerLog.isDebugEnabled()) {
- containerLog.debug("Deregistering sso id '" + ssoId + "'");
- }
-
// Look up and remove the corresponding SingleSignOnEntry
SingleSignOnEntry sso = cache.remove(ssoId);
if (sso == null) {
+ if (containerLog.isDebugEnabled()) {
+
containerLog.debug(sm.getString("singleSignOn.debug.deregisterFail", ssoId));
+ }
return;
}
// Expire any associated sessions
- for (SingleSignOnSessionKey ssoKey : sso.findSessions()) {
- if (containerLog.isTraceEnabled()) {
- containerLog.trace(" Invalidating session " + ssoKey);
+ Set<SingleSignOnSessionKey> ssoKeys = sso.findSessions();
+ if (ssoKeys.size() == 0) {
+ if (containerLog.isDebugEnabled()) {
+
containerLog.debug(sm.getString("singleSignOn.debug.deregisterNone", ssoId));
+ }
+ }
+ for (SingleSignOnSessionKey ssoKey : ssoKeys) {
+ if (containerLog.isDebugEnabled()) {
+
containerLog.debug(sm.getString("singleSignOn.debug.deregister", ssoKey,
ssoId));
}
// Invalidate this session
expire(ssoKey);
@@ -488,8 +503,8 @@ public class SingleSignOn extends ValveB
String username, String password) {
if (containerLog.isDebugEnabled()) {
- containerLog.debug("Registering sso id '" + ssoId + "' for user '"
+
- (principal != null ? principal.getName() : "") + "' with auth
type '" + authType + "'");
+ containerLog.debug(sm.getString("singleSignOn.debug.register",
ssoId,
+ principal != null ? principal.getName() : "", authType));
}
cache.put(ssoId, new SingleSignOnEntry(principal, authType, username,
password));
@@ -530,7 +545,7 @@ public class SingleSignOn extends ValveB
SingleSignOnEntry sso = cache.get(ssoId);
if (sso != null && !sso.getCanReauthenticate()) {
if (containerLog.isDebugEnabled()) {
- containerLog.debug("Update sso id " + ssoId + " to auth type "
+ authType);
+ containerLog.debug(sm.getString("singleSignOn.debug.update",
ssoId, authType));
}
sso.updateCredentials(principal, authType, username, password);
@@ -550,8 +565,7 @@ public class SingleSignOn extends ValveB
protected void removeSession(String ssoId, Session session) {
if (containerLog.isDebugEnabled()) {
- containerLog.debug("Removing session " + session.toString() + "
from sso id " +
- ssoId );
+
containerLog.debug(sm.getString("singleSignOn.debug.removeSession", session,
ssoId));
}
// Get a reference to the SingleSignOn
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]