Permalink
Browse files

Add some logging to user service

  • Loading branch information...
1 parent b483f10 commit 5b50da5cff906cd92a5ddf9656d3de96eb44440e Samuel Cochran committed Jul 28, 2011
Showing with 7 additions and 9 deletions.
  1. +7 −9 src/main/java/au/com/gaiaresources/bdrs/security/AuthenticationService.java
@@ -17,27 +17,25 @@
public class AuthenticationService implements UserDetailsService {
@Autowired
private UserDAO userDAO;
-
+
@SuppressWarnings("unused")
private Logger log = Logger.getLogger(AuthenticationService.class);
-
+
/**
* {@inheritDoc}
*/
@Override
public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException, DataAccessException {
- User u = userDAO.getUser(userName);
+ User u = userDAO.getUser(userName);
if (u == null) {
+ log.warn("User " + userName + " not found.");
throw new UsernameNotFoundException("User " + userName + " not found.");
-// u = userDAO.getRootUser(userName);
-// if(u == null) {
-// throw new UsernameNotFoundException("User " + userName + " not found.");
-// }
}
+ log.info("User " + userName + " found, id " + u.getId().toString() + ".");
return new UserDetails(u);
}
-
-
+
+
public User getUserByRegistrationKey(String rego){
User u = userDAO.getUserByRegistrationKey(rego);
return u;

0 comments on commit 5b50da5

Please sign in to comment.