Skip to content

Commit

Permalink
used placeholders instead of concatenation in Log message's
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-opsmx committed Dec 11, 2023
1 parent 3784d8b commit 55f387e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void onApplicationEvent(AbstractAuthenticationEvent event) {
if (event.getAuthentication().isAuthenticated()
&& event instanceof InteractiveAuthenticationSuccessEvent) {
log.debug("publishEvent InteractiveAuthenticationSuccessEvent");
log.info("Login: User '"+event.getAuthentication().getName()+"' logged in successfully.");
log.info("Login: User '{}' logged in successfully.",event.getAuthentication().getName());
handleAuthenticationEvent(event, AuditEventType.AUTHENTICATION_SUCCESSFUL_AUDIT);
return;
}
Expand All @@ -69,7 +69,7 @@ public void onApplicationEvent(AbstractAuthenticationEvent event) {
} else if (!event.getAuthentication().isAuthenticated()
&& event instanceof AbstractAuthenticationFailureEvent) {
log.debug("publishEvent AbstractAuthenticationFailureEvent");
log.info("Login : User '"+event.getAuthentication().getName()+"' login failed due to incorrect credentials.");
log.info("Login : User '{}' login failed due to incorrect credentials.",event.getAuthentication().getName());
template.asyncSendBody(
CamelEndpointConstant.directUserActivity,
auditHandler.publishEvent(AuditEventType.AUTHENTICATION_FAILURE_AUDIT, event));
Expand All @@ -80,12 +80,12 @@ public void onApplicationEvent(AbstractAuthenticationEvent event) {
.getName()
.equals("org.springframework.security.providers.ExpiringUsernameAuthenticationToken")) {
log.debug("publishEvent LogoutSuccessEvent with ExpiringUsernameAuthenticationToken");
log.info("Logout : User '"+event.getAuthentication().getName()+"' logged out.");
log.info("Logout : User '{}' logged out.",event.getAuthentication().getName());
handleAuthenticationEvent(event, AuditEventType.SUCCESSFUL_USER_LOGOUT_AUDIT);
return;
}
log.debug("publishEvent LogoutSuccessEvent");
log.info("Logout : User '"+event.getAuthentication().getName()+"' logged out manually.");
log.info("Logout : User '{}' logged out manually.",event.getAuthentication().getName());
auditHandler.publishEvent(AuditEventType.SUCCESSFUL_USER_LOGOUT_AUDIT, event);
AbstractAuthenticationToken auth = (AbstractAuthenticationToken) event.getAuthentication();
String name = auth.getName();
Expand Down

0 comments on commit 55f387e

Please sign in to comment.