Skip to content

Commit

Permalink
Replace org.apache.log4j.Logger with slf4j.
Browse files Browse the repository at this point in the history
Allows to switch logging impl when moving to Grails 2.0.0.RC1 and up as log4j became optional
  • Loading branch information
dsklyut committed Oct 21, 2011
1 parent 9559c1d commit 74a5f77
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
Expand Up @@ -14,10 +14,12 @@
*/
package org.codehaus.groovy.grails.plugins.springsecurity

import org.apache.log4j.Logger

import org.codehaus.groovy.grails.commons.GrailsApplication
import org.springframework.security.web.authentication.rememberme.PersistentRememberMeToken
import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository
import org.slf4j.Logger
import org.slf4j.LoggerFactory

/**
* GORM-based PersistentTokenRepository implementation, based on {@link JdbcTokenRepositoryImpl}.
Expand All @@ -26,7 +28,7 @@ import org.springframework.security.web.authentication.rememberme.PersistentToke
*/
class GormPersistentTokenRepository implements PersistentTokenRepository {

private final Logger log = Logger.getLogger(getClass())
private final Logger log = LoggerFactory.getLogger(getClass())

/** Dependency injection for grailsApplication */
GrailsApplication grailsApplication
Expand Down
Expand Up @@ -14,11 +14,12 @@
*/
package org.codehaus.groovy.grails.plugins.springsecurity

import org.apache.log4j.Logger
import org.springframework.security.core.GrantedAuthority
import org.springframework.security.core.authority.GrantedAuthorityImpl
import org.springframework.security.core.userdetails.UserDetails
import org.springframework.security.core.userdetails.UsernameNotFoundException
import org.slf4j.Logger
import org.slf4j.LoggerFactory

/**
* Default implementation of <code>GrailsUserDetailsService</code> that uses
Expand All @@ -28,7 +29,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException
*/
class GormUserDetailsService implements GrailsUserDetailsService {

private Logger _log = Logger.getLogger(getClass())
private Logger _log = LoggerFactory.getLogger(getClass())

/**
* Some Spring Security classes (e.g. RoleHierarchyVoter) expect at least one role, so
Expand Down
Expand Up @@ -24,7 +24,8 @@
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.expression.Expression;
import org.springframework.security.access.AccessDecisionVoter;
Expand Down Expand Up @@ -55,7 +56,7 @@ public abstract class AbstractFilterInvocationDefinition

private final Map<Object, Collection<ConfigAttribute>> _compiled = new LinkedHashMap<Object, Collection<ConfigAttribute>>();

protected final Logger _log = Logger.getLogger(getClass());
protected final Logger _log = LoggerFactory.getLogger(getClass());

protected static final Collection<ConfigAttribute> DENY = Collections.emptyList();

Expand Down
Expand Up @@ -14,7 +14,8 @@
*/
package org.codehaus.groovy.grails.plugins.springsecurity;

import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.security.authentication.CredentialsExpiredException;
import org.springframework.security.core.SpringSecurityMessageSource;
Expand All @@ -30,7 +31,7 @@
public class DefaultPostAuthenticationChecks implements UserDetailsChecker {

protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
protected final Logger log = Logger.getLogger(getClass());
protected final Logger log = LoggerFactory.getLogger(getClass());

public void check(UserDetails user) {
if (!user.isCredentialsNonExpired()) {
Expand Down
Expand Up @@ -14,7 +14,8 @@
*/
package org.codehaus.groovy.grails.plugins.springsecurity;

import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.security.authentication.AccountExpiredException;
import org.springframework.security.authentication.DisabledException;
Expand All @@ -32,7 +33,7 @@
public class DefaultPreAuthenticationChecks implements UserDetailsChecker {

protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
protected final Logger log = Logger.getLogger(getClass());
protected final Logger log = LoggerFactory.getLogger(getClass());

public void check(UserDetails user) {
if (!user.isAccountNonLocked()) {
Expand Down
Expand Up @@ -27,7 +27,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.codehaus.groovy.grails.web.util.WebUtils;
import org.springframework.security.web.util.IpAddressMatcher;
import org.springframework.util.AntPathMatcher;
Expand All @@ -46,7 +47,7 @@
*/
public class IpAddressFilter extends GenericFilterBean {

private final Logger _log = Logger.getLogger(getClass());
private final Logger _log = LoggerFactory.getLogger(getClass());

private final AntPathMatcher _pathMatcher = new AntPathMatcher();

Expand Down

0 comments on commit 74a5f77

Please sign in to comment.