aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-11-30 15:10:15 +0700
committerGravatar Alexander Alexeev2016-11-30 15:10:15 +0700
commit1d837a835c04078ec66325e9fb9de21ac401874e (patch)
tree428217d2c617b9caf2eb6d42a7716789881d0937 /juick-server/src/main/java/com/juick
parentb45c000ed478f2407288aab1532425288f998689 (diff)
prevent string concatenation for disabled loggers
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r--juick-server/src/main/java/com/juick/service/security/SimpleRememberMeServices.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/service/security/SimpleRememberMeServices.java b/juick-server/src/main/java/com/juick/service/security/SimpleRememberMeServices.java
index 2a28866c..aef133d3 100644
--- a/juick-server/src/main/java/com/juick/service/security/SimpleRememberMeServices.java
+++ b/juick-server/src/main/java/com/juick/service/security/SimpleRememberMeServices.java
@@ -5,6 +5,8 @@ import com.juick.server.security.entities.JuickUser;
import com.juick.service.UserService;
import com.juick.util.UserUtils;
import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;
@@ -23,6 +25,8 @@ import java.util.Optional;
* Created by aalexeev on 11/28/16.
*/
public class SimpleRememberMeServices extends AbstractRememberMeServices implements RememberMeServices {
+ private static final Logger logger = LoggerFactory.getLogger(SimpleRememberMeServices.class);
+
private final UserService userService;
public SimpleRememberMeServices(
@@ -49,7 +53,7 @@ public class SimpleRememberMeServices extends AbstractRememberMeServices impleme
HttpServletRequest request, HttpServletResponse response, Authentication successfulAuthentication) {
String username = successfulAuthentication.getName();
- logger.debug("Creating new persistent login for user " + username);
+ logger.debug("Creating new persistent login for user {}", username);
try {
int uid = userService.getUIDbyName(username);
@@ -62,7 +66,7 @@ public class SimpleRememberMeServices extends AbstractRememberMeServices impleme
setCookie(new String[]{hash}, getTokenValiditySeconds(), request, response);
} catch (Exception e) {
- logger.error("Failed to save cookies ", e);
+ logger.error("Failed to save cookies", e);
}
}