This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new ba6071bed3 Differentiate trace and debug log levels
ba6071bed3 is described below
commit ba6071bed33b4b64091500c7d3603924ac17ccae
Author: remm <[email protected]>
AuthorDate: Fri Feb 2 22:14:39 2024 +0100
Differentiate trace and debug log levels
---
java/org/apache/catalina/mapper/Mapper.java | 4 +-
.../mbeans/GlobalResourcesLifecycleListener.java | 26 ++---
java/org/apache/catalina/realm/CombinedRealm.java | 74 ++++++-------
.../catalina/realm/JAASMemoryLoginModule.java | 16 +--
java/org/apache/catalina/realm/JAASRealm.java | 34 +++---
java/org/apache/catalina/realm/JNDIRealm.java | 32 +++---
java/org/apache/catalina/realm/MemoryRealm.java | 4 +-
java/org/apache/catalina/realm/RealmBase.java | 114 ++++++++++-----------
8 files changed, 154 insertions(+), 150 deletions(-)
diff --git a/java/org/apache/catalina/mapper/Mapper.java
b/java/org/apache/catalina/mapper/Mapper.java
index 61d4c9c177..b46efbe382 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -508,8 +508,8 @@ public final class Mapper {
protected void removeWrapper(ContextVersion context, String path) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("mapper.removeWrapper", context.name,
path));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("mapper.removeWrapper", context.name,
path));
}
synchronized (context) {
diff --git
a/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
b/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
index c688b6e515..feba89cf8e 100644
--- a/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
+++ b/java/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
@@ -130,8 +130,8 @@ public class GlobalResourcesLifecycleListener implements
LifecycleListener {
Binding binding = bindings.next();
String name = prefix + binding.getName();
Object value = context.lookup(binding.getName());
- if (log.isDebugEnabled()) {
- log.debug("Checking resource " + name);
+ if (log.isTraceEnabled()) {
+ log.trace("Checking resource " + name);
}
if (value instanceof Context) {
createMBeans(name + "/", (Context) value);
@@ -162,9 +162,9 @@ public class GlobalResourcesLifecycleListener implements
LifecycleListener {
protected void createMBeans(String name, UserDatabase database) throws
Exception {
// Create the MBean for the UserDatabase itself
- if (log.isDebugEnabled()) {
- log.debug("Creating UserDatabase MBeans for resource " + name);
- log.debug("Database=" + database);
+ if (log.isTraceEnabled()) {
+ log.trace("Creating UserDatabase MBeans for resource " + name);
+ log.trace("Database=" + database);
}
try {
MBeanUtils.createMBean(database);
@@ -181,8 +181,8 @@ public class GlobalResourcesLifecycleListener implements
LifecycleListener {
Iterator<Role> roles = database.getRoles();
while (roles.hasNext()) {
Role role = roles.next();
- if (log.isDebugEnabled()) {
- log.debug(" Creating Role MBean for role " + role);
+ if (log.isTraceEnabled()) {
+ log.trace(" Creating Role MBean for role " + role);
}
try {
MBeanUtils.createMBean(role);
@@ -196,8 +196,8 @@ public class GlobalResourcesLifecycleListener implements
LifecycleListener {
Iterator<Group> groups = database.getGroups();
while (groups.hasNext()) {
Group group = groups.next();
- if (log.isDebugEnabled()) {
- log.debug(" Creating Group MBean for group " + group);
+ if (log.isTraceEnabled()) {
+ log.trace(" Creating Group MBean for group " + group);
}
try {
MBeanUtils.createMBean(group);
@@ -211,8 +211,8 @@ public class GlobalResourcesLifecycleListener implements
LifecycleListener {
Iterator<User> users = database.getUsers();
while (users.hasNext()) {
User user = users.next();
- if (log.isDebugEnabled()) {
- log.debug(" Creating User MBean for user " + user);
+ if (log.isTraceEnabled()) {
+ log.trace(" Creating User MBean for user " + user);
}
try {
MBeanUtils.createMBean(user);
@@ -228,8 +228,8 @@ public class GlobalResourcesLifecycleListener implements
LifecycleListener {
* Destroy the MBeans for the interesting global JNDI resources.
*/
protected void destroyMBeans() {
- if (log.isDebugEnabled()) {
- log.debug("Destroying MBeans for Global JNDI Resources");
+ if (log.isTraceEnabled()) {
+ log.trace("Destroying MBeans for Global JNDI Resources");
}
}
}
diff --git a/java/org/apache/catalina/realm/CombinedRealm.java
b/java/org/apache/catalina/realm/CombinedRealm.java
index ffb3ff22cd..0a97c340f2 100644
--- a/java/org/apache/catalina/realm/CombinedRealm.java
+++ b/java/org/apache/catalina/realm/CombinedRealm.java
@@ -60,7 +60,7 @@ public class CombinedRealm extends RealmBase {
realms.add(theRealm);
if (log.isDebugEnabled()) {
- sm.getString("combinedRealm.addRealm",
theRealm.getClass().getName(), Integer.toString(realms.size()));
+ log.debug(sm.getString("combinedRealm.addRealm",
theRealm.getClass().getName(), Integer.toString(realms.size())));
}
}
@@ -93,20 +93,20 @@ public class CombinedRealm extends RealmBase {
Principal authenticatedUser = null;
for (Realm realm : realms) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authStart", username,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authStart", username,
realm.getClass().getName()));
}
authenticatedUser =
realm.authenticate(username, clientDigest, nonce, nc,
cnonce, qop, realmName, digestA2, algorithm);
if (authenticatedUser == null) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authFail", username,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authFail", username,
realm.getClass().getName()));
}
} else {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authSuccess",
username, realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authSuccess",
username, realm.getClass().getName()));
}
break;
}
@@ -120,19 +120,19 @@ public class CombinedRealm extends RealmBase {
Principal authenticatedUser = null;
for (Realm realm : realms) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authStart", username,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authStart", username,
realm.getClass().getName()));
}
authenticatedUser = realm.authenticate(username);
if (authenticatedUser == null) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authFail", username,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authFail", username,
realm.getClass().getName()));
}
} else {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authSuccess",
username, realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authSuccess",
username, realm.getClass().getName()));
}
break;
}
@@ -146,19 +146,19 @@ public class CombinedRealm extends RealmBase {
Principal authenticatedUser = null;
for (Realm realm : realms) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authStart", username,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authStart", username,
realm.getClass().getName()));
}
authenticatedUser = realm.authenticate(username, credentials);
if (authenticatedUser == null) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authFail", username,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authFail", username,
realm.getClass().getName()));
}
} else {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authSuccess",
username, realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authSuccess",
username, realm.getClass().getName()));
}
break;
}
@@ -257,19 +257,19 @@ public class CombinedRealm extends RealmBase {
}
for (Realm realm : realms) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authStart", username,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authStart", username,
realm.getClass().getName()));
}
authenticatedUser = realm.authenticate(certs);
if (authenticatedUser == null) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authFail", username,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authFail", username,
realm.getClass().getName()));
}
} else {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authSuccess",
username, realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authSuccess",
username, realm.getClass().getName()));
}
break;
}
@@ -291,19 +291,19 @@ public class CombinedRealm extends RealmBase {
}
for (Realm realm : realms) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authStart", gssName,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authStart", gssName,
realm.getClass().getName()));
}
authenticatedUser = realm.authenticate(gssContext, storeCred);
if (authenticatedUser == null) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authFail",
gssName, realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authFail",
gssName, realm.getClass().getName()));
}
} else {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authSuccess",
gssName, realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authSuccess",
gssName, realm.getClass().getName()));
}
break;
}
@@ -321,19 +321,19 @@ public class CombinedRealm extends RealmBase {
Principal authenticatedUser = null;
for (Realm realm : realms) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authStart", gssName,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authStart", gssName,
realm.getClass().getName()));
}
authenticatedUser = realm.authenticate(gssName, gssCredential);
if (authenticatedUser == null) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authFail", gssName,
realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authFail", gssName,
realm.getClass().getName()));
}
} else {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("combinedRealm.authSuccess",
gssName, realm.getClass().getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("combinedRealm.authSuccess",
gssName, realm.getClass().getName()));
}
break;
}
diff --git a/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
b/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
index cff832dbd6..91953b1c75 100644
--- a/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
+++ b/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
@@ -121,8 +121,8 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
// --------------------------------------------------------- Public Methods
public JAASMemoryLoginModule() {
- if (log.isDebugEnabled()) {
- log.debug("MEMORY LOGIN MODULE");
+ if (log.isTraceEnabled()) {
+ log.trace("MEMORY LOGIN MODULE");
}
}
@@ -142,8 +142,8 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
committed = false;
principal = null;
}
- if (log.isDebugEnabled()) {
- log.debug("Abort");
+ if (log.isTraceEnabled()) {
+ log.trace("Abort");
}
return true;
}
@@ -151,8 +151,8 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
@Override
public boolean commit() throws LoginException {
- if (log.isDebugEnabled()) {
- log.debug("commit " + principal);
+ if (log.isTraceEnabled()) {
+ log.trace("commit " + principal);
}
// If authentication was not successful, just return false
@@ -182,8 +182,8 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
@Override
public void initialize(Subject subject, CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options) {
- if (log.isDebugEnabled()) {
- log.debug("Init");
+ if (log.isTraceEnabled()) {
+ log.trace("Init");
}
// Save configuration values
diff --git a/java/org/apache/catalina/realm/JAASRealm.java
b/java/org/apache/catalina/realm/JAASRealm.java
index abb4574df7..eb436d8d60 100644
--- a/java/org/apache/catalina/realm/JAASRealm.java
+++ b/java/org/apache/catalina/realm/JAASRealm.java
@@ -340,8 +340,8 @@ public class JAASRealm extends RealmBase {
appName = "Tomcat";
}
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("jaasRealm.beginLogin", username,
appName));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("jaasRealm.beginLogin", username,
appName));
}
// What if the LoginModule is in the container class loader ?
@@ -370,8 +370,8 @@ public class JAASRealm extends RealmBase {
}
}
- if (log.isDebugEnabled()) {
- log.debug("Login context created " + username);
+ if (log.isTraceEnabled()) {
+ log.trace("Login context created " + username);
}
// Negotiate a login via this LoginContext
@@ -429,23 +429,25 @@ public class JAASRealm extends RealmBase {
return null;
}
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("jaasRealm.loginContextCreated",
username));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("jaasRealm.loginContextCreated",
username));
}
// Return the appropriate Principal for this authenticated Subject
Principal principal = createPrincipal(username, subject,
loginContext);
if (principal == null) {
- log.debug(sm.getString("jaasRealm.authenticateFailure",
username));
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString("jaasRealm.authenticateFailure",
username));
+ }
return null;
}
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("jaasRealm.authenticateSuccess",
username, principal));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("jaasRealm.authenticateSuccess",
username, principal));
}
return principal;
} catch (Throwable t) {
- log.error("error ", t);
+ log.error(sm.getString("jaasRealm.unexpectedError"), t);
// JAAS throws exception different than LoginException so mark the
realm as unavailable
invocationSuccess = false;
return null;
@@ -499,21 +501,21 @@ public class JAASRealm extends RealmBase {
for (Principal principal : subject.getPrincipals()) {
String principalClass = principal.getClass().getName();
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("jaasRealm.checkPrincipal", principal,
principalClass));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("jaasRealm.checkPrincipal", principal,
principalClass));
}
if (userPrincipal == null && userClasses.contains(principalClass))
{
userPrincipal = principal;
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("jaasRealm.userPrincipalSuccess",
principal.getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("jaasRealm.userPrincipalSuccess",
principal.getName()));
}
}
if (roleClasses.contains(principalClass)) {
roles.add(principal.getName());
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("jaasRealm.rolePrincipalAdd",
principal.getName()));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("jaasRealm.rolePrincipalAdd",
principal.getName()));
}
}
}
diff --git a/java/org/apache/catalina/realm/JNDIRealm.java
b/java/org/apache/catalina/realm/JNDIRealm.java
index 0cfc594b21..58eeb943b6 100644
--- a/java/org/apache/catalina/realm/JNDIRealm.java
+++ b/java/org/apache/catalina/realm/JNDIRealm.java
@@ -965,7 +965,9 @@ public class JNDIRealm extends RealmBase {
this.cipherSuitesArray = null;
} else {
this.cipherSuitesArray = cipherSuites.trim().split("\\s*,\\s*");
- containerLog.debug(sm.getString("jndiRealm.cipherSuites",
Arrays.toString(this.cipherSuitesArray)));
+ if (containerLog.isTraceEnabled()) {
+ containerLog.trace(sm.getString("jndiRealm.cipherSuites",
Arrays.toString(this.cipherSuitesArray)));
+ }
}
return this.cipherSuitesArray;
}
@@ -1254,8 +1256,8 @@ public class JNDIRealm extends RealmBase {
if (checkCredentials(connection.context, user,
credentials)) {
// Search for additional roles
List<String> roles = getRoles(connection,
user);
- if (containerLog.isDebugEnabled()) {
- containerLog.debug("Found roles: " +
((roles == null) ? "" : roles.toString()));
+ if (containerLog.isTraceEnabled()) {
+ containerLog.trace("Found roles: " +
((roles == null) ? "" : roles.toString()));
}
return new GenericPrincipal(username,
credentials, roles);
}
@@ -1284,8 +1286,8 @@ public class JNDIRealm extends RealmBase {
// Search for additional roles
List<String> roles = getRoles(connection, user);
- if (containerLog.isDebugEnabled()) {
- containerLog.debug("Found roles: " + ((roles == null) ? ""
: roles.toString()));
+ if (containerLog.isTraceEnabled()) {
+ containerLog.trace("Found roles: " + ((roles == null) ? ""
: roles.toString()));
}
// Create and return a suitable Principal for this user
@@ -1496,8 +1498,8 @@ public class JNDIRealm extends RealmBase {
// Use pattern or search for user entry
if (userPatternArray != null && curUserPattern >= 0) {
user = getUserByPattern(connection, username, credentials,
attrIds, curUserPattern);
- if (containerLog.isDebugEnabled()) {
- containerLog.debug("Found user by pattern [" + user + "]");
+ if (containerLog.isTraceEnabled()) {
+ containerLog.trace("Found user by pattern [" + user + "]");
}
} else {
boolean thisUserSearchAsUser = isUserSearchAsUser();
@@ -1511,8 +1513,8 @@ public class JNDIRealm extends RealmBase {
userCredentialsRemove(connection.context);
}
}
- if (containerLog.isDebugEnabled()) {
- containerLog.debug("Found user by search [" + user + "]");
+ if (containerLog.isTraceEnabled()) {
+ containerLog.trace("Found user by search [" + user + "]");
}
}
if (userPassword == null && credentials != null && user != null) {
@@ -2217,8 +2219,8 @@ public class JNDIRealm extends RealmBase {
}
// Close our opened connection
try {
- if (containerLog.isDebugEnabled()) {
- containerLog.debug("Closing directory context");
+ if (containerLog.isTraceEnabled()) {
+ containerLog.trace("Closing directory context");
}
connection.context.close();
} catch (NamingException e) {
@@ -2676,10 +2678,10 @@ public class JNDIRealm extends RealmBase {
Hashtable<String,String> env = new Hashtable<>();
// Configure our directory context environment.
- if (containerLog.isDebugEnabled() && connectionAttempt == 0) {
- containerLog.debug("Connecting to URL " + connectionURL);
- } else if (containerLog.isDebugEnabled() && connectionAttempt > 0) {
- containerLog.debug("Connecting to URL " + alternateURL);
+ if (containerLog.isTraceEnabled() && connectionAttempt == 0) {
+ containerLog.trace("Connecting to URL " + connectionURL);
+ } else if (containerLog.isTraceEnabled() && connectionAttempt > 0) {
+ containerLog.trace("Connecting to URL " + alternateURL);
}
env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
if (connectionName != null) {
diff --git a/java/org/apache/catalina/realm/MemoryRealm.java
b/java/org/apache/catalina/realm/MemoryRealm.java
index 96a0dcdfd7..77eec2eaf2 100644
--- a/java/org/apache/catalina/realm/MemoryRealm.java
+++ b/java/org/apache/catalina/realm/MemoryRealm.java
@@ -219,8 +219,8 @@ public class MemoryRealm extends RealmBase {
String pathName = getPathname();
try (InputStream is =
ConfigFileLoader.getSource().getResource(pathName).getInputStream()) {
// Load the contents of the database file
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("memoryRealm.loadPath", pathName));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("memoryRealm.loadPath", pathName));
}
synchronized (digesterLock) {
diff --git a/java/org/apache/catalina/realm/RealmBase.java
b/java/org/apache/catalina/realm/RealmBase.java
index b71efd7955..25d8dfe4e8 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -417,8 +417,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
String serverDigest =
HexUtils.toHexString(ConcurrentMessageDigest.digest(algorithm, valueBytes));
- if (log.isDebugEnabled()) {
- log.debug("Digest : " + clientDigest + " Username:" + username + "
ClientDigest:" + clientDigest +
+ if (log.isTraceEnabled()) {
+ log.trace("Digest : " + clientDigest + " Username:" + username + "
ClientDigest:" + clientDigest +
" nonce:" + nonce + " nc:" + nc + " cnonce:" + cnonce + "
qop:" + qop + " realm:" + realm +
"digestA2:" + digestA2 + " Server digest:" + serverDigest);
}
@@ -439,13 +439,13 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
}
// Check the validity of each certificate in the chain
- if (log.isDebugEnabled()) {
- log.debug("Authenticating client certificate chain");
+ if (log.isTraceEnabled()) {
+ log.trace("Authenticating client certificate chain");
}
if (validate) {
for (X509Certificate cert : certs) {
- if (log.isDebugEnabled()) {
- log.debug(" Checking validity for '" +
cert.getSubjectX500Principal().toString() + "'");
+ if (log.isTraceEnabled()) {
+ log.trace(" Checking validity for '" +
cert.getSubjectX500Principal().toString() + "'");
}
try {
cert.checkValidity();
@@ -483,8 +483,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
log.warn(sm.getString("realmBase.delegatedCredentialFail", gssName), e);
}
} else {
- if (log.isDebugEnabled()) {
-
log.debug(sm.getString("realmBase.credentialNotDelegated", gssName));
+ if (log.isTraceEnabled()) {
+
log.trace(sm.getString("realmBase.credentialNotDelegated", gssName));
}
}
}
@@ -528,8 +528,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
// Are there any defined security constraints?
SecurityConstraint constraints[] = context.findConstraints();
if (constraints == null || constraints.length == 0) {
- if (log.isDebugEnabled()) {
- log.debug(" No applicable constraints defined");
+ if (log.isTraceEnabled()) {
+ log.trace(" No applicable constraints defined");
}
return null;
}
@@ -554,8 +554,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
continue;
}
- if (log.isDebugEnabled()) {
- log.debug(" Checking constraint '" + constraints[i] + "'
against " + method + " " + uri + " --> " +
+ if (log.isTraceEnabled()) {
+ log.trace(" Checking constraint '" + constraints[i] + "'
against " + method + " " + uri + " --> " +
constraints[i].included(uri, method));
}
@@ -598,8 +598,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
continue;
}
- if (log.isDebugEnabled()) {
- log.debug(" Checking constraint '" + constraints[i] + "'
against " + method + " " + uri + " --> " +
+ if (log.isTraceEnabled()) {
+ log.trace(" Checking constraint '" + constraints[i] + "'
against " + method + " " + uri + " --> " +
constraints[i].included(uri, method));
}
@@ -660,8 +660,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
continue;
}
- if (log.isDebugEnabled()) {
- log.debug(" Checking constraint '" + constraints[i] + "'
against " + method + " " + uri + " --> " +
+ if (log.isTraceEnabled()) {
+ log.trace(" Checking constraint '" + constraints[i] + "'
against " + method + " " + uri + " --> " +
constraints[i].included(uri, method));
}
@@ -715,8 +715,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
continue;
}
- if (log.isDebugEnabled()) {
- log.debug(" Checking constraint '" + constraints[i] + "'
against " + method + " " + uri + " --> " +
+ if (log.isTraceEnabled()) {
+ log.trace(" Checking constraint '" + constraints[i] + "'
against " + method + " " + uri + " --> " +
constraints[i].included(uri, method));
}
@@ -747,8 +747,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
if (results == null) {
// No applicable security constraint was found
- if (log.isDebugEnabled()) {
- log.debug(" No applicable constraint located");
+ if (log.isTraceEnabled()) {
+ log.trace(" No applicable constraint located");
}
}
return resultsToArray(results);
@@ -790,50 +790,50 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
roles = new String[0];
}
- if (log.isDebugEnabled()) {
- log.debug(" Checking roles " + principal);
+ if (log.isTraceEnabled()) {
+ log.trace(" Checking roles " + principal);
}
if (constraint.getAuthenticatedUsers() && principal != null) {
- if (log.isDebugEnabled()) {
- log.debug("Passing all authenticated users");
+ if (log.isTraceEnabled()) {
+ log.trace("Passing all authenticated users");
}
status = true;
} else if (roles.length == 0 && !constraint.getAllRoles() &&
!constraint.getAuthenticatedUsers()) {
if (constraint.getAuthConstraint()) {
- if (log.isDebugEnabled()) {
- log.debug("No roles");
+ if (log.isTraceEnabled()) {
+ log.trace("No roles");
}
status = false; // No listed roles means no access at all
denyfromall = true;
break;
}
- if (log.isDebugEnabled()) {
- log.debug("Passing all access");
+ if (log.isTraceEnabled()) {
+ log.trace("Passing all access");
}
status = true;
} else if (principal == null) {
- if (log.isDebugEnabled()) {
- log.debug(" No user authenticated, cannot grant access");
+ if (log.isTraceEnabled()) {
+ log.trace(" No user authenticated, cannot grant access");
}
} else {
for (String role : roles) {
if (hasRole(request.getWrapper(), principal, role)) {
status = true;
- if (log.isDebugEnabled()) {
- log.debug("Role found: " + role);
+ if (log.isTraceEnabled()) {
+ log.trace("Role found: " + role);
}
- } else if (log.isDebugEnabled()) {
- log.debug("No role found: " + role);
+ } else if (log.isTraceEnabled()) {
+ log.trace("No role found: " + role);
}
}
}
}
if (!denyfromall && allRolesMode != AllRolesMode.STRICT_MODE &&
!status && principal != null) {
- if (log.isDebugEnabled()) {
- log.debug("Checking for all roles mode: " + allRolesMode);
+ if (log.isTraceEnabled()) {
+ log.trace("Checking for all roles mode: " + allRolesMode);
}
// Check for an all roles(role-name="*")
for (SecurityConstraint constraint : constraints) {
@@ -841,8 +841,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
// If the all roles mode exists, sets
if (constraint.getAllRoles()) {
if (allRolesMode == AllRolesMode.AUTH_ONLY_MODE) {
- if (log.isDebugEnabled()) {
- log.debug("Granting access for role-name=*,
auth-only");
+ if (log.isTraceEnabled()) {
+ log.trace("Granting access for role-name=*,
auth-only");
}
status = true;
break;
@@ -854,8 +854,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
roles = new String[0];
}
if (roles.length == 0 && allRolesMode ==
AllRolesMode.STRICT_AUTH_ONLY_MODE) {
- if (log.isDebugEnabled()) {
- log.debug("Granting access for role-name=*, strict
auth-only");
+ if (log.isTraceEnabled()) {
+ log.trace("Granting access for role-name=*, strict
auth-only");
}
status = true;
break;
@@ -897,12 +897,12 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
boolean result = hasRoleInternal(principal, role);
- if (log.isDebugEnabled()) {
+ if (log.isTraceEnabled()) {
String name = principal.getName();
if (result) {
- log.debug(sm.getString("realmBase.hasRoleSuccess", name,
role));
+ log.trace(sm.getString("realmBase.hasRoleSuccess", name,
role));
} else {
- log.debug(sm.getString("realmBase.hasRoleFailure", name,
role));
+ log.trace(sm.getString("realmBase.hasRoleFailure", name,
role));
}
}
@@ -972,22 +972,22 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
// Is there a relevant user data constraint?
if (constraints == null || constraints.length == 0) {
- if (log.isDebugEnabled()) {
- log.debug(" No applicable security constraint defined");
+ if (log.isTraceEnabled()) {
+ log.trace(" No applicable security constraint defined");
}
return true;
}
for (SecurityConstraint constraint : constraints) {
String userConstraint = constraint.getUserConstraint();
if (userConstraint == null) {
- if (log.isDebugEnabled()) {
- log.debug(" No applicable user data constraint defined");
+ if (log.isTraceEnabled()) {
+ log.trace(" No applicable user data constraint defined");
}
return true;
}
if (userConstraint.equals(TransportGuarantee.NONE.name())) {
- if (log.isDebugEnabled()) {
- log.debug(" User data constraint has no restrictions");
+ if (log.isTraceEnabled()) {
+ log.trace(" User data constraint has no restrictions");
}
return true;
}
@@ -995,8 +995,8 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
// Validate the request against the user data constraint
if (request.getRequest().isSecure()) {
- if (log.isDebugEnabled()) {
- log.debug(" User data constraint already satisfied");
+ if (log.isTraceEnabled()) {
+ log.trace(" User data constraint already satisfied");
}
return true;
}
@@ -1005,8 +1005,8 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
// Is redirecting disabled?
if (redirectPort <= 0) {
- if (log.isDebugEnabled()) {
- log.debug(" SSL redirect is disabled");
+ if (log.isTraceEnabled()) {
+ log.trace(" SSL redirect is disabled");
}
response.sendError(HttpServletResponse.SC_FORBIDDEN,
request.getRequestURI());
return false;
@@ -1036,8 +1036,8 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
file.append('?');
file.append(queryString);
}
- if (log.isDebugEnabled()) {
- log.debug(" Redirecting to " + file.toString());
+ if (log.isTraceEnabled()) {
+ log.trace(" Redirecting to " + file.toString());
}
response.sendRedirect(file.toString(),
transportGuaranteeRedirectStatus);
return false;
@@ -1204,8 +1204,8 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
protected Principal getPrincipal(X509Certificate usercert) {
String username = x509UsernameRetriever.getUsername(usercert);
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("realmBase.gotX509Username", username));
+ if (log.isTraceEnabled()) {
+ log.trace(sm.getString("realmBase.gotX509Username", username));
}
return getPrincipal(username);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]