Skip to content
Browse files

Replace org.apache.log4j.Logger with slf4j.

Allows to switch logging impl when moving to Grails 2.0.0.RC1 and up as log4j became optional
  • Loading branch information...
1 parent 9559c1d commit 74a5f7731d6845d18f14102624630d249b4041ce @dsklyut committed Oct 21, 2011
View
6 ...vy/org/codehaus/groovy/grails/plugins/springsecurity/GormPersistentTokenRepository.groovy
@@ -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}.
@@ -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
View
5 src/groovy/org/codehaus/groovy/grails/plugins/springsecurity/GormUserDetailsService.groovy
@@ -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
@@ -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
View
5 ...org/codehaus/groovy/grails/plugins/springsecurity/AbstractFilterInvocationDefinition.java
@@ -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;
@@ -55,7 +56,7 @@
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();
View
5 ...va/org/codehaus/groovy/grails/plugins/springsecurity/DefaultPostAuthenticationChecks.java
@@ -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;
@@ -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()) {
View
5 ...ava/org/codehaus/groovy/grails/plugins/springsecurity/DefaultPreAuthenticationChecks.java
@@ -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;
@@ -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()) {
View
5 src/java/org/codehaus/groovy/grails/plugins/springsecurity/IpAddressFilter.java
@@ -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;
@@ -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();

0 comments on commit 74a5f77

Please sign in to comment.
Something went wrong with that request. Please try again.