Improve logging.

This commit is contained in:
Ben Alex 2005-02-20 05:37:13 +00:00
parent f23e2d7145
commit 6d693ac0d4
1 changed files with 11 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* Copyright 2004 Acegi Technology Pty Limited /* Copyright 2004, 2005 Acegi Technology Pty Limited
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -82,7 +82,7 @@ public abstract class AbstractIntegrationFilter implements InitializingBean,
//~ Static fields/initializers ============================================= //~ Static fields/initializers =============================================
protected static final Log logger = LogFactory.getLog(AbstractIntegrationFilter.class); protected static final Log logger = LogFactory.getLog(AbstractIntegrationFilter.class);
private static final String FILTER_APPLIED = "__acegi_integration_fitlerapplied"; private static final String FILTER_APPLIED = "__acegi_integration_filterapplied";
//~ Instance fields ======================================================== //~ Instance fields ========================================================
@ -134,8 +134,8 @@ public abstract class AbstractIntegrationFilter implements InitializingBean,
if (extracted instanceof Authentication) { if (extracted instanceof Authentication) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug( logger.debug("Authentication '" + extracted
"Authentication added to ContextHolder from container"); + "' added to ContextHolder from container");
} }
Authentication auth = (Authentication) extracted; Authentication auth = (Authentication) extracted;
@ -172,15 +172,17 @@ public abstract class AbstractIntegrationFilter implements InitializingBean,
// Remove authentication information // Remove authentication information
if ((ContextHolder.getContext() != null) if ((ContextHolder.getContext() != null)
&& ContextHolder.getContext() instanceof SecureContext) { && ContextHolder.getContext() instanceof SecureContext) {
if (logger.isDebugEnabled()) {
logger.debug(
"Updating container with new Authentication object, and then removing Authentication from ContextHolder");
}
// Get context holder // Get context holder
SecureContext secureContext = (SecureContext) ContextHolder SecureContext secureContext = (SecureContext) ContextHolder
.getContext(); .getContext();
if (logger.isDebugEnabled()) {
logger.debug(
"Updating container with new Authentication object ('"
+ secureContext.getAuthentication()
+ "'), and then removing Authentication from ContextHolder");
}
// Update container with new Authentication object (may have been updated during method invocation) // Update container with new Authentication object (may have been updated during method invocation)
this.commitToContainer(request, this.commitToContainer(request,
secureContext.getAuthentication()); secureContext.getAuthentication());