cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: Minor logging work
Date Fri, 09 Oct 2015 10:17:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 6e0e97278 -> c0526a6e5


Minor logging work


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c0526a6e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c0526a6e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c0526a6e

Branch: refs/heads/master
Commit: c0526a6e55a1eef931bc9257cdd419b64818ea41
Parents: 6e0e972
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Oct 9 11:17:47 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Oct 9 11:17:47 2015 +0100

----------------------------------------------------------------------
 .../AbstractXACMLAuthorizingInterceptor.java    |  4 +-
 .../ws/security/trust/AbstractSTSClient.java    | 13 +++++--
 .../wss4j/AbstractWSS4JStaxInterceptor.java     |  4 +-
 .../AbstractCommonBindingHandler.java           |  4 +-
 .../org/apache/cxf/sts/StaticSTSProperties.java | 29 ++++++++++----
 .../cxf/sts/claims/LdapGroupClaimsHandler.java  |  8 ++--
 .../cxf/sts/claims/mapper/JexlClaimsMapper.java |  5 ++-
 .../cxf/sts/operation/AbstractOperation.java    | 22 ++++++++---
 .../org/apache/cxf/sts/request/Lifetime.java    | 11 ++++--
 .../apache/cxf/sts/request/ReceivedToken.java   |  7 +++-
 .../apache/cxf/sts/request/RequestParser.java   | 41 +++++++-------------
 .../apache/cxf/sts/service/StaticService.java   | 13 +++++--
 .../token/delegation/SAMLDelegationHandler.java |  6 ++-
 .../provider/AbstractSAMLTokenProvider.java     | 13 +++++--
 .../token/provider/DefaultSubjectProvider.java  | 12 ++++--
 .../sts/token/provider/SAMLTokenProvider.java   | 40 +++++++++++--------
 .../cxf/sts/token/provider/SCTProvider.java     |  4 +-
 .../sts/token/realm/CertConstraintsParser.java  |  5 ++-
 .../apache/cxf/sts/token/realm/SAMLRealm.java   | 13 +++++--
 .../sts/token/validator/SAMLTokenValidator.java |  4 +-
 20 files changed, 169 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/AbstractXACMLAuthorizingInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/AbstractXACMLAuthorizingInterceptor.java b/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/AbstractXACMLAuthorizingInterceptor.java
index 39e611d..65ab0a9 100644
--- a/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/AbstractXACMLAuthorizingInterceptor.java
+++ b/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/AbstractXACMLAuthorizingInterceptor.java
@@ -143,7 +143,9 @@ public abstract class AbstractXACMLAuthorizingInterceptor extends AbstractPhaseI
                 code = status.getStatusCode() != null ? status.getStatusCode().getValue() : "";
                 statusMessage = status.getStatusMessage() != null ? status.getStatusMessage().getValue() : "";
             }
-            LOG.fine("XACML authorization result: " + decision + ", code: " + code + ", message: " + statusMessage);
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("XACML authorization result: " + decision + ", code: " + code + ", message: " + statusMessage);
+            }
             return decision == DECISION.Permit;
         }
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
index a5310a0..15911cc 100755
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
@@ -31,6 +31,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.security.auth.callback.Callback;
@@ -488,7 +489,9 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
         if (location != null) {
             location = location.trim();
         }
-        LOG.fine("EPR address: " + location);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("EPR address: " + location);
+        }
         
         final QName sName = EndpointReferenceUtils.getServiceName(ref, bus);
         if (sName != null) {
@@ -497,7 +500,9 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
             if (epName != null) {
                 endpointName = epName;
             }
-            LOG.fine("EPR endpoint: " + serviceName + " " + endpointName);
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("EPR endpoint: " + serviceName + " " + endpointName);
+            }
         }
         final String wsdlLoc = EndpointReferenceUtils.getWSDLLocation(ref);
         if (wsdlLoc != null) {
@@ -505,7 +510,9 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
         }
         
         String mexLoc = findMEXLocation(ref, useEPRWSAAddrAsMEXLocation);
-        LOG.fine("WS-MEX location: " + mexLoc);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("WS-MEX location: " + mexLoc);
+        }
         if (mexLoc != null) {
             try {
                 JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
index 5a200a2..f34c6fd 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
@@ -344,7 +344,7 @@ public abstract class AbstractWSS4JStaxInterceptor implements SoapInterceptor,
                     cryptos.put(refId, crypto);
                 }
             }
-            if (crypto == null) {
+            if (crypto == null && LOG.isLoggable(Level.INFO)) {
                 LOG.info("The Crypto reference " + refId + " specified by "
                     + cryptoPropertyRefId + " could not be loaded"
                 );
@@ -362,7 +362,7 @@ public abstract class AbstractWSS4JStaxInterceptor implements SoapInterceptor,
                     crypto = loadCryptoFromPropertiesFile(soapMessage, propFile, securityProperties);
                     cryptos.put(propFile, crypto);
                 }
-                if (crypto == null) {
+                if (crypto == null && LOG.isLoggable(Level.INFO)) {
                     LOG.info(
                          "The Crypto properties file " + propFile + " specified by "
                          + cryptoPropertyFile + " could not be loaded or found"

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractCommonBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractCommonBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractCommonBindingHandler.java
index 0356490..159cf59 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractCommonBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractCommonBindingHandler.java
@@ -76,7 +76,9 @@ public abstract class AbstractCommonBindingHandler {
         if (assertion == null) {
             return;
         }
-        LOG.log(Level.FINE, "Not asserting " + assertion.getName() + ": " + reason);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.log(Level.FINE, "Not asserting " + assertion.getName() + ": " + reason);
+        }
         AssertionInfoMap aim = message.get(AssertionInfoMap.class);
         Collection<AssertionInfo> ais = aim.get(assertion.getName());
         if (ais != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java
index 3dfbe54..99e4b3b 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java
@@ -21,6 +21,7 @@ package org.apache.cxf.sts;
 import java.net.URL;
 import java.util.List;
 import java.util.Properties;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.security.auth.callback.CallbackHandler;
@@ -131,7 +132,9 @@ public class StaticSTSProperties implements STSPropertiesMBean {
      */
     public void setCallbackHandler(CallbackHandler callbackHandler) {
         this.callbackHandler = callbackHandler;
-        LOG.fine("Setting callbackHandler: " + callbackHandler);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting callbackHandler: " + callbackHandler);
+        }
     }
     
     /**
@@ -140,7 +143,9 @@ public class StaticSTSProperties implements STSPropertiesMBean {
      */
     public void setCallbackHandlerClass(String callbackHandlerClass) {
         this.callbackHandlerClass = callbackHandlerClass;
-        LOG.fine("Setting callbackHandlerClass: " + callbackHandlerClass);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting callbackHandlerClass: " + callbackHandlerClass);
+        }
     }
     
     /**
@@ -175,7 +180,9 @@ public class StaticSTSProperties implements STSPropertiesMBean {
      */
     public void setSignatureCryptoProperties(Object signatureCryptoProperties) {
         this.signatureCryptoProperties = signatureCryptoProperties;
-        LOG.fine("Setting signature crypto properties: " + signatureCryptoProperties);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting signature crypto properties: " + signatureCryptoProperties);
+        }
     }
     
     /**
@@ -192,7 +199,9 @@ public class StaticSTSProperties implements STSPropertiesMBean {
      */
     public void setSignatureUsername(String signatureUsername) {
         this.signatureUsername = signatureUsername;
-        LOG.fine("Setting signatureUsername: " + signatureUsername);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting signatureUsername: " + signatureUsername);
+        }
     }
     
     /**
@@ -227,7 +236,9 @@ public class StaticSTSProperties implements STSPropertiesMBean {
      */
     public void setEncryptionCryptoProperties(Object encryptionCryptoProperties) {
         this.encryptionCryptoProperties = encryptionCryptoProperties;
-        LOG.fine("Setting encryptionProperties: " + encryptionCryptoProperties);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting encryptionProperties: " + encryptionCryptoProperties);
+        }
     }
     
     /**
@@ -245,7 +256,9 @@ public class StaticSTSProperties implements STSPropertiesMBean {
      */
     public void setEncryptionUsername(String encryptionUsername) {
         this.encryptionUsername = encryptionUsername;
-        LOG.fine("Setting encryptionUsername: " + encryptionUsername);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting encryptionUsername: " + encryptionUsername);
+        }
     }
     
     /**
@@ -279,7 +292,9 @@ public class StaticSTSProperties implements STSPropertiesMBean {
      */
     public void setIssuer(String issuer) {
         this.issuer = issuer;
-        LOG.fine("Setting issuer: " + issuer);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting issuer: " + issuer);
+        }
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java
index 21cf925..cbe940e 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java
@@ -217,7 +217,9 @@ public class LdapGroupClaimsHandler implements ClaimsHandler, RealmSupport {
                                              this.getUserNameAttribute(), user);
             if (dn != null) {
                 user = dn.toString();
-                LOG.fine("DN for (" + this.getUserNameAttribute() + "=" + user + ") found: " + user);
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("DN for (" + this.getUserNameAttribute() + "=" + user + ") found: " + user);
+                }
             } else {
                 LOG.warning("DN not found for user '" + user + "'");
                 return new ProcessedClaimCollection();
@@ -293,7 +295,7 @@ public class LdapGroupClaimsHandler implements ClaimsHandler, RealmSupport {
                         role = parseRole(group, this.groupNameGlobalFilter);
                     }
                     filteredGroups.add(role);
-                } else {
+                } else if (LOG.isLoggable(Level.FINER)) {
                     LOG.finer("Group '" + group + "' doesn't match scoped and global group filter");
                 }
             }
@@ -334,4 +336,4 @@ public class LdapGroupClaimsHandler implements ClaimsHandler, RealmSupport {
         return group.substring(roleStart, group.length() - trimEnd);
     }
     
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
index 8faffcb..2d1261a 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.commons.jexl2.JexlContext;
@@ -93,7 +94,9 @@ public class JexlClaimsMapper implements ClaimsMapper {
         URL resource = ClassLoaderUtils.getResource(scriptLocation, this.getClass());
         if (resource != null) {
             scriptLocation = resource.getPath();
-            LOG.fine("Script found within Classpath: " + scriptLocation);
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("Script found within Classpath: " + scriptLocation);
+            }
         }
         File scriptFile = new File(scriptLocation);
         if (scriptFile.exists()) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
index 386f32b..d7c2c45 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
@@ -299,9 +299,11 @@ public abstract class AbstractOperation {
 
         XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
         created.setValue(fmt.format(creationTime));
-        LOG.fine("Token lifetime creation: " + created.getValue());
         expires.setValue(fmt.format(expirationTime));
-        LOG.fine("Token lifetime expiration: " + expires.getValue());
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Token lifetime creation: " + created.getValue());
+            LOG.fine("Token lifetime expiration: " + expires.getValue());
+        }
         
         LifetimeType lifetimeType = QNameConstants.WS_TRUST_FACTORY.createLifetimeType();
         lifetimeType.setCreated(created);
@@ -338,7 +340,9 @@ public abstract class AbstractOperation {
                 encryptionProperties.getAcceptedEncryptionAlgorithms();
             if (!supportedAlgorithms.contains(encryptionAlgorithm)) {
                 encryptionAlgorithm = encryptionProperties.getEncryptionAlgorithm();
-                LOG.fine("EncryptionAlgorithm not supported, defaulting to: " + encryptionAlgorithm);
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("EncryptionAlgorithm not supported, defaulting to: " + encryptionAlgorithm);
+                }
             }
         }
         // Get the key-wrap algorithm to use
@@ -351,7 +355,9 @@ public abstract class AbstractOperation {
                 encryptionProperties.getAcceptedKeyWrapAlgorithms();
             if (!supportedAlgorithms.contains(keyWrapAlgorithm)) {
                 keyWrapAlgorithm = encryptionProperties.getKeyWrapAlgorithm();
-                LOG.fine("KeyWrapAlgorithm not supported, defaulting to: " + keyWrapAlgorithm);
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("KeyWrapAlgorithm not supported, defaulting to: " + keyWrapAlgorithm);
+                }
             }
         }
         
@@ -405,7 +411,9 @@ public abstract class AbstractOperation {
                 encryptionProperties.getAcceptedKeyWrapAlgorithms();
             if (!supportedAlgorithms.contains(keyWrapAlgorithm)) {
                 keyWrapAlgorithm = encryptionProperties.getKeyWrapAlgorithm();
-                LOG.fine("KeyWrapAlgorithm not supported, defaulting to: " + keyWrapAlgorithm);
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("KeyWrapAlgorithm not supported, defaulting to: " + keyWrapAlgorithm);
+                }
             }
         }
         
@@ -475,7 +483,9 @@ public abstract class AbstractOperation {
         
         // Extract AppliesTo
         String address = extractAddressFromAppliesTo(tokenRequirements.getAppliesTo());
-        LOG.fine("The AppliesTo address that has been received is: " + address);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("The AppliesTo address that has been received is: " + address);
+        }
         providerParameters.setAppliesToAddress(address);
         
         // Get the realm of the request

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/Lifetime.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/Lifetime.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/Lifetime.java
index 434bee2..2188157 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/Lifetime.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/Lifetime.java
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.sts.request;
 
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
@@ -37,7 +38,9 @@ public class Lifetime {
 
     public void setCreated(String created) {
         this.created = created;
-        LOG.fine("Found created value: " + created);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Found created value: " + created);
+        }
     }
 
     public String getExpires() {
@@ -46,7 +49,9 @@ public class Lifetime {
 
     public void setExpires(String expires) {
         this.expires = expires;
-        LOG.fine("Found expires value: " + expires);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Found expires value: " + expires);
+        }
     }
     
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/ReceivedToken.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/ReceivedToken.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/ReceivedToken.java
index 678b3ef..c2e1aee 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/ReceivedToken.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/ReceivedToken.java
@@ -20,6 +20,7 @@ package org.apache.cxf.sts.request;
 
 import java.security.Principal;
 import java.util.Set;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.xml.bind.JAXBElement;
@@ -68,7 +69,9 @@ public class ReceivedToken {
             }
             token = ((JAXBElement<?>)receivedToken).getValue();
         } else if (receivedToken instanceof Element) {
-            LOG.fine("Found ValidateTarget element: " + ((Element)receivedToken).getLocalName());
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("Found ValidateTarget element: " + ((Element)receivedToken).getLocalName());
+            }
             this.token = receivedToken;
             isDOMElement = true;
         } else {
@@ -143,4 +146,4 @@ public class ReceivedToken {
         this.roles = roles;
     }
     
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
index 201ffc4..7e9df4a 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
@@ -109,6 +109,9 @@ public class RequestParser {
             // JAXB types
             if (requestObject instanceof JAXBElement<?>) {
                 JAXBElement<?> jaxbElement = (JAXBElement<?>) requestObject;
+                if (jaxbElement != null && LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("Found " + jaxbElement.getName() + ": " + jaxbElement.getValue());
+                }
                 try {
                     boolean found = 
                         parseTokenRequirements(jaxbElement, tokenRequirements, wsContext, claimsParsers);
@@ -161,7 +164,9 @@ public class RequestParser {
         }
         String context = request.getContext();
         tokenRequirements.setContext(context);
-        LOG.fine("Received Context attribute: " + context);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Received Context attribute: " + context);
+        }
         
         RequestRequirements requestRequirements = new RequestRequirements();
         requestRequirements.setKeyRequirements(keyRequirements);
@@ -180,35 +185,27 @@ public class RequestParser {
         if (QNameConstants.AUTHENTICATION_TYPE.equals(jaxbElement.getName())) {
             String authenticationType = (String)jaxbElement.getValue();
             keyRequirements.setAuthenticationType(authenticationType);
-            LOG.fine("Found AuthenticationType: " + authenticationType);
         } else if (QNameConstants.KEY_TYPE.equals(jaxbElement.getName())) {
             String keyType = (String)jaxbElement.getValue();
             keyRequirements.setKeyType(keyType);
-            LOG.fine("Found KeyType: " + keyType);
         } else if (QNameConstants.KEY_SIZE.equals(jaxbElement.getName())) {
             long keySize = ((Long)jaxbElement.getValue()).longValue();
             keyRequirements.setKeySize(keySize);
-            LOG.fine("Found KeySize: " + keySize);
         } else if (QNameConstants.SIGNATURE_ALGORITHM.equals(jaxbElement.getName())) {
             String signatureAlgorithm = (String)jaxbElement.getValue();
             keyRequirements.setSignatureAlgorithm(signatureAlgorithm);
-            LOG.fine("Found Signature Algorithm: " + signatureAlgorithm);
         } else if (QNameConstants.ENCRYPTION_ALGORITHM.equals(jaxbElement.getName())) {
             String encryptionAlgorithm = (String)jaxbElement.getValue();
             keyRequirements.setEncryptionAlgorithm(encryptionAlgorithm);
-            LOG.fine("Found Encryption Algorithm: " + encryptionAlgorithm);
         } else if (QNameConstants.C14N_ALGORITHM.equals(jaxbElement.getName())) {
             String c14nAlgorithm = (String)jaxbElement.getValue();
             keyRequirements.setC14nAlgorithm(c14nAlgorithm);
-            LOG.fine("Found C14n Algorithm: " + c14nAlgorithm);
         } else if (QNameConstants.COMPUTED_KEY_ALGORITHM.equals(jaxbElement.getName())) {
             String computedKeyAlgorithm = (String)jaxbElement.getValue();
             keyRequirements.setComputedKeyAlgorithm(computedKeyAlgorithm);
-            LOG.fine("Found ComputedKeyAlgorithm: " + computedKeyAlgorithm);
         } else if (QNameConstants.KEYWRAP_ALGORITHM.equals(jaxbElement.getName())) {
             String keywrapAlgorithm = (String)jaxbElement.getValue();
             keyRequirements.setKeywrapAlgorithm(keywrapAlgorithm);
-            LOG.fine("Found KeyWrapAlgorithm: " + keywrapAlgorithm);
         } else if (QNameConstants.USE_KEY.equals(jaxbElement.getName())) {
             UseKeyType useKey = (UseKeyType)jaxbElement.getValue();
             ReceivedKey receivedKey = parseUseKey(useKey, wsContext);
@@ -220,11 +217,9 @@ public class RequestParser {
         } else if (QNameConstants.SIGN_WITH.equals(jaxbElement.getName())) {
             String signWith = (String)jaxbElement.getValue();
             keyRequirements.setSignWith(signWith);
-            LOG.fine("Found SignWith: " + signWith);
         } else if (QNameConstants.ENCRYPT_WITH.equals(jaxbElement.getName())) {
             String encryptWith = (String)jaxbElement.getValue();
             keyRequirements.setEncryptWith(encryptWith);
-            LOG.fine("Found EncryptWith: " + encryptWith);
         } else if (QNameConstants.REQUEST_TYPE.equals(jaxbElement.getName())) { //NOPMD
             // Skip the request type.
         } else {
@@ -245,17 +240,14 @@ public class RequestParser {
         if (QNameConstants.TOKEN_TYPE.equals(jaxbElement.getName())) {
             String tokenType = (String)jaxbElement.getValue();
             tokenRequirements.setTokenType(tokenType);
-            LOG.fine("Found TokenType: " + tokenType);
         } else if (QNameConstants.ON_BEHALF_OF.equals(jaxbElement.getName())) {
             OnBehalfOfType onBehalfOfType = (OnBehalfOfType)jaxbElement.getValue();
             ReceivedToken onBehalfOf = new ReceivedToken(onBehalfOfType.getAny());
             tokenRequirements.setOnBehalfOf(onBehalfOf);
-            LOG.fine("Found OnBehalfOf token");
         } else if (QNameConstants.ACT_AS.equals(jaxbElement.getName())) {
             ActAsType actAsType = (ActAsType)jaxbElement.getValue();
             ReceivedToken actAs = new ReceivedToken(actAsType.getAny());
             tokenRequirements.setActAs(actAs);
-            LOG.fine("Found ActAs token");
         } else if (QNameConstants.LIFETIME.equals(jaxbElement.getName())) {
             LifetimeType lifetimeType = (LifetimeType)jaxbElement.getValue();
             Lifetime lifetime = new Lifetime();
@@ -266,7 +258,6 @@ public class RequestParser {
                 lifetime.setExpires(lifetimeType.getExpires().getValue());
             }
             tokenRequirements.setLifetime(lifetime);
-            LOG.fine("Found Lifetime element");
         } else if (QNameConstants.VALIDATE_TARGET.equals(jaxbElement.getName())) {
             ValidateTargetType validateTargetType = (ValidateTargetType)jaxbElement.getValue();
             ReceivedToken validateTarget = new ReceivedToken(validateTargetType.getAny());
@@ -275,7 +266,6 @@ public class RequestParser {
                 validateTarget = new ReceivedToken(target);
             }  
             tokenRequirements.setValidateTarget(validateTarget);
-            LOG.fine("Found ValidateTarget token");
         } else if (QNameConstants.CANCEL_TARGET.equals(jaxbElement.getName())) {
             CancelTargetType cancelTargetType = (CancelTargetType)jaxbElement.getValue();
             ReceivedToken cancelTarget = new ReceivedToken(cancelTargetType.getAny());
@@ -284,7 +274,6 @@ public class RequestParser {
                 cancelTarget = new ReceivedToken(target);
             }          
             tokenRequirements.setCancelTarget(cancelTarget);
-            LOG.fine("Found CancelTarget token");
         } else if (QNameConstants.RENEW_TARGET.equals(jaxbElement.getName())) {
             RenewTargetType renewTargetType = (RenewTargetType)jaxbElement.getValue();
             ReceivedToken renewTarget = new ReceivedToken(renewTargetType.getAny());
@@ -293,12 +282,10 @@ public class RequestParser {
                 renewTarget = new ReceivedToken(target);
             }          
             tokenRequirements.setRenewTarget(renewTarget);
-            LOG.fine("Found CancelTarget token");
         } else if (QNameConstants.CLAIMS.equals(jaxbElement.getName())) {
             ClaimsType claimsType = (ClaimsType)jaxbElement.getValue();
             ClaimCollection requestedClaims = parseClaims(claimsType, claimsParsers);
             tokenRequirements.setPrimaryClaims(requestedClaims);
-            LOG.fine("Found Primary Claims token");
         } else if (QNameConstants.RENEWING.equals(jaxbElement.getName())) {
             RenewingType renewingType = (RenewingType)jaxbElement.getValue();
             Renewing renewing = new Renewing();
@@ -309,13 +296,11 @@ public class RequestParser {
                 renewing.setAllowRenewingAfterExpiry(renewingType.isOK());
             }
             tokenRequirements.setRenewing(renewing);
-            LOG.fine("Found Renewing token");
         } else if (QNameConstants.PARTICIPANTS.equals(jaxbElement.getName())) {
             ParticipantsType participantsType = (ParticipantsType)jaxbElement.getValue();
             
             Participants participants = parseParticipants(participantsType);
             tokenRequirements.setParticipants(participants);
-            LOG.fine("Found Participants");
         } else {
             return false;
         }
@@ -519,7 +504,7 @@ public class RequestParser {
                     binarySecret.setBinarySecretValue(binarySecretType.getValue());
                     entropy.setBinarySecret(binarySecret);
                     return entropy;
-                } else {
+                } else if (LOG.isLoggable(Level.FINE)) {
                     LOG.fine("Unsupported Entropy type: " + entropyObjectJaxb.getName());
                 }
             } else if (entropyObject instanceof Element
@@ -564,23 +549,23 @@ public class RequestParser {
         while (child != null) {
             String localName = child.getLocalName();
             String namespace = child.getNamespaceURI();
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("Found " + localName + ": " + child.getTextContent().trim());
+            }
+            
             if (keyRequirements.getKeySize() == 0 && "KeySize".equals(localName) 
                 && STSConstants.WST_NS_05_12.equals(namespace)) {
                 long keySize = Integer.parseInt(child.getTextContent().trim());
                 keyRequirements.setKeySize(keySize);
-                LOG.fine("Found KeySize: " + keySize);
             } else if (tokenRequirements.getTokenType() == null 
                 && "TokenType".equals(localName) && STSConstants.WST_NS_05_12.equals(namespace)) {
                 String tokenType = child.getTextContent().trim();
                 tokenRequirements.setTokenType(tokenType);
-                LOG.fine("Found TokenType: " + tokenType);
             } else if (keyRequirements.getKeyType() == null 
                 && "KeyType".equals(localName) && STSConstants.WST_NS_05_12.equals(namespace)) {
                 String keyType = child.getTextContent().trim();
-                LOG.fine("Found KeyType: " + keyType);
                 keyRequirements.setKeyType(keyType);
             } else if ("Claims".equals(localName) && STSConstants.WST_NS_05_12.equals(namespace)) {
-                LOG.fine("Found Secondary Claims element");
                 ClaimCollection requestedClaims = parseClaims(child, claimsParsers);
                 tokenRequirements.setSecondaryClaims(requestedClaims);
             } else {
@@ -725,7 +710,9 @@ public class RequestParser {
             }
         }
         
-        LOG.fine("Reference URI found " + referenceURI);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Reference URI found " + referenceURI);
+        }
         if (referenceURI == null) {
             LOG.log(Level.WARNING, "No Reference URI was received");
             throw new STSException(

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/StaticService.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/StaticService.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/StaticService.java
index cfd7ffd..0180939 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/StaticService.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/StaticService.java
@@ -22,6 +22,7 @@ package org.apache.cxf.sts.service;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -56,7 +57,9 @@ public class StaticService implements ServiceMBean {
         for (Pattern endpointPattern : endpointPatterns) {
             final Matcher matcher = endpointPattern.matcher(addressToMatch);
             if (matcher.matches()) {
-                LOG.fine("Address " + address + " matches with pattern " + endpointPattern);
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("Address " + address + " matches with pattern " + endpointPattern);
+                }
                 return true;
             }
         }
@@ -75,7 +78,9 @@ public class StaticService implements ServiceMBean {
      */
     public void setTokenType(String tokenType) {
         this.tokenType = tokenType;
-        LOG.fine("Setting Token Type: " + tokenType);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting Token Type: " + tokenType);
+        }
     }
     
     /**
@@ -90,7 +95,9 @@ public class StaticService implements ServiceMBean {
      */
     public void setKeyType(String keyType) {
         this.keyType = keyType;
-        LOG.fine("Setting Key Type: " + keyType);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting Key Type: " + keyType);
+        }
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
index c7ef7e7..675e6ab 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
@@ -72,9 +72,11 @@ public class SAMLDelegationHandler implements TokenDelegationHandler {
         }
         
         if (isDelegationAllowed(delegateTarget, tokenParameters.getAppliesToAddress())) {
-            LOG.fine("Delegation is allowed for principal " + tokenParameters.getPrincipal());
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("Delegation is allowed for principal " + tokenParameters.getPrincipal());
+            }
             response.setDelegationAllowed(true);
-        } else {
+        } else if (LOG.isLoggable(Level.FINE)) {
             LOG.fine("Delegation is not allowed for principal " + tokenParameters.getPrincipal());
         }
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/AbstractSAMLTokenProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/AbstractSAMLTokenProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/AbstractSAMLTokenProvider.java
index a798d43..ed33eb8 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/AbstractSAMLTokenProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/AbstractSAMLTokenProvider.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.sts.token.provider;
 
 import java.util.List;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.security.auth.callback.CallbackHandler;
@@ -77,7 +78,9 @@ public abstract class AbstractSAMLTokenProvider {
                 signatureProperties.getAcceptedSignatureAlgorithms();
             if (!supportedAlgorithms.contains(signatureAlgorithm)) {
                 signatureAlgorithm = signatureProperties.getSignatureAlgorithm();
-                LOG.fine("SignatureAlgorithm not supported, defaulting to: " + signatureAlgorithm);
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("SignatureAlgorithm not supported, defaulting to: " + signatureAlgorithm);
+                }
             }
         }
 
@@ -91,14 +94,18 @@ public abstract class AbstractSAMLTokenProvider {
                 signatureProperties.getAcceptedC14nAlgorithms();
             if (!supportedAlgorithms.contains(c14nAlgorithm)) {
                 c14nAlgorithm = signatureProperties.getC14nAlgorithm();
-                LOG.fine("C14nAlgorithm not supported, defaulting to: " + c14nAlgorithm);
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("C14nAlgorithm not supported, defaulting to: " + c14nAlgorithm);
+                }
             }
         }
 
         // If alias not defined, get the default of the SignatureCrypto
         if ((alias == null || "".equals(alias)) && (signatureCrypto != null)) {
             alias = signatureCrypto.getDefaultX509Identifier();
-            LOG.fine("Signature alias is null so using default alias: " + alias);
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("Signature alias is null so using default alias: " + alias);
+            }
         }
         // Get the password
         WSPasswordCallback[] cb = {new WSPasswordCallback(alias, WSPasswordCallback.SIGNATURE)};

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
index 5e8a8ee..4116f92 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
@@ -73,7 +73,9 @@ public class DefaultSubjectProvider implements SubjectProvider {
      */
     public void setSubjectNameQualifier(String subjectNameQualifier) {
         this.subjectNameQualifier = subjectNameQualifier;
-        LOG.fine("Setting Subject Name Qualifier: " + subjectNameQualifier);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting Subject Name Qualifier: " + subjectNameQualifier);
+        }
     }
 
     /**
@@ -81,7 +83,9 @@ public class DefaultSubjectProvider implements SubjectProvider {
      */
     public void setSubjectNameIDFormat(String subjectNameIDFormat) {
         this.subjectNameIDFormat = subjectNameIDFormat;
-        LOG.fine("Setting Subject Name format: " + subjectNameIDFormat);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting Subject Name format: " + subjectNameIDFormat);
+        }
     }
 
     /**
@@ -186,7 +190,9 @@ public class DefaultSubjectProvider implements SubjectProvider {
 
         SubjectBean subjectBean =
             new SubjectBean(subjectName, subjectNameQualifier, confirmationMethod);
-        LOG.fine("Creating new subject with principal name: " + principal.getName());
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Creating new subject with principal name: " + principal.getName());
+        }
         subjectBean.setSubjectNameIDFormat(localSubjectNameIDFormat);
 
         return subjectBean;

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
index feac5bd..aafe972 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
@@ -94,7 +94,9 @@ public class SAMLTokenProvider extends AbstractSAMLTokenProvider implements Toke
         testKeyType(tokenParameters);
         KeyRequirements keyRequirements = tokenParameters.getKeyRequirements();
         TokenRequirements tokenRequirements = tokenParameters.getTokenRequirements();
-        LOG.fine("Handling token of type: " + tokenRequirements.getTokenType());
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Handling token of type: " + tokenRequirements.getTokenType());
+        }
         
         byte[] secret = null;
         byte[] entropyBytes = null;
@@ -319,11 +321,13 @@ public class SAMLTokenProvider extends AbstractSAMLTokenProvider implements Toke
             for (AttributeStatementProvider statementProvider : attributeStatementProviders) {
                 AttributeStatementBean statementBean = statementProvider.getStatement(tokenParameters);
                 if (statementBean != null) {
-                    LOG.fine(
-                        "AttributeStatements" + statementBean.toString() 
-                        + "returned by AttributeStatementProvider " 
-                        + statementProvider.getClass().getName()
-                    );
+                    if (LOG.isLoggable(Level.FINE)) {
+                        LOG.fine(
+                            "AttributeStatements" + statementBean.toString() 
+                            + "returned by AttributeStatementProvider " 
+                            + statementProvider.getClass().getName()
+                        );
+                    }
                     attrBeanList.add(statementBean);
                     statementAdded = true;
                 }
@@ -337,11 +341,13 @@ public class SAMLTokenProvider extends AbstractSAMLTokenProvider implements Toke
             for (AuthenticationStatementProvider statementProvider : authenticationStatementProviders) {
                 AuthenticationStatementBean statementBean = statementProvider.getStatement(tokenParameters);
                 if (statementBean != null) {
-                    LOG.fine(
-                        "AuthenticationStatement" + statementBean.toString() 
-                        + "returned by AuthenticationStatementProvider " 
-                        + statementProvider.getClass().getName()
-                    );
+                    if (LOG.isLoggable(Level.FINE)) {
+                        LOG.fine(
+                            "AuthenticationStatement" + statementBean.toString() 
+                            + "returned by AuthenticationStatementProvider " 
+                            + statementProvider.getClass().getName()
+                        );
+                    }
                     authBeanList.add(statementBean);
                     statementAdded = true;
                 }
@@ -356,11 +362,13 @@ public class SAMLTokenProvider extends AbstractSAMLTokenProvider implements Toke
             for (AuthDecisionStatementProvider statementProvider : authDecisionStatementProviders) {
                 AuthDecisionStatementBean statementBean = statementProvider.getStatement(tokenParameters);
                 if (statementBean != null) {
-                    LOG.fine(
-                        "AuthDecisionStatement" + statementBean.toString() 
-                        + "returned by AuthDecisionStatementProvider " 
-                        + statementProvider.getClass().getName()
-                    );
+                    if (LOG.isLoggable(Level.FINE)) {
+                        LOG.fine(
+                            "AuthDecisionStatement" + statementBean.toString() 
+                            + "returned by AuthDecisionStatementProvider " 
+                            + statementProvider.getClass().getName()
+                        );
+                    }
                     authDecisionBeanList.add(statementBean);
                     statementAdded = true;
                 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
index 51780f0..27f83f0 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
@@ -103,7 +103,9 @@ public class SCTProvider implements TokenProvider {
      */
     public TokenProviderResponse createToken(TokenProviderParameters tokenParameters) {
         TokenRequirements tokenRequirements = tokenParameters.getTokenRequirements();
-        LOG.fine("Handling token of type: " + tokenRequirements.getTokenType());
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Handling token of type: " + tokenRequirements.getTokenType());
+        }
         
         if (tokenParameters.getTokenStore() == null) {
             LOG.log(Level.FINE, "A cache must be configured to use the SCTProvider");

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/CertConstraintsParser.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/CertConstraintsParser.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/CertConstraintsParser.java
index 9b46ea8..8c7913e 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/CertConstraintsParser.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/CertConstraintsParser.java
@@ -22,6 +22,7 @@ package org.apache.cxf.sts.token.realm;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -81,7 +82,9 @@ public class CertConstraintsParser {
             for (Pattern subjectDNPattern : subjectDNPatterns) {
                 final Matcher matcher = subjectDNPattern.matcher(subjectName);
                 if (matcher.matches()) {
-                    LOG.fine("Subject DN " + subjectName + " matches with pattern " + subjectDNPattern);
+                    if (LOG.isLoggable(Level.FINE)) {
+                        LOG.fine("Subject DN " + subjectName + " matches with pattern " + subjectDNPattern);
+                    }
                     subjectMatch = true;
                     break;
                 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/SAMLRealm.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/SAMLRealm.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/SAMLRealm.java
index 881a19f..37c4ce6 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/SAMLRealm.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/realm/SAMLRealm.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.sts.token.realm;
 
 import java.util.Properties;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.security.auth.callback.CallbackHandler;
@@ -95,7 +96,9 @@ public class SAMLRealm {
      */
     public void setSignaturePropertiesFile(String signaturePropertiesFile) {
         this.signaturePropertiesFile = signaturePropertiesFile;
-        LOG.fine("Setting signature properties: " + signaturePropertiesFile);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting signature properties: " + signaturePropertiesFile);
+        }
     }
     
     /**
@@ -144,7 +147,9 @@ public class SAMLRealm {
      */
     public void setCallbackHandler(CallbackHandler callbackHandler) {
         this.callbackHandler = callbackHandler;
-        LOG.fine("Setting callbackHandler: " + callbackHandler);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting callbackHandler: " + callbackHandler);
+        }
     }
     
     /**
@@ -153,7 +158,9 @@ public class SAMLRealm {
      */
     public void setCallbackHandlerClass(String callbackHandlerClass) {
         this.callbackHandlerClass = callbackHandlerClass;
-        LOG.fine("Setting callbackHandlerClass: " + callbackHandlerClass);
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Setting callbackHandlerClass: " + callbackHandlerClass);
+        }
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/c0526a6e/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
index 8896c4a..7cf1e31 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
@@ -188,7 +188,9 @@ public class SAMLTokenValidator implements TokenValidator {
                 }
             }
             if (secToken != null && secToken.isExpired()) {
-                LOG.fine("Token: " + secToken.getId() + " is in the cache but expired - revalidating");
+                if (LOG.isLoggable(Level.FINE)) {
+                    LOG.fine("Token: " + secToken.getId() + " is in the cache but expired - revalidating");
+                }
                 secToken = null;
             }
             


Mime
View raw message