From 55f387e21d244b83c9674f4ceb59b04c23773deb Mon Sep 17 00:00:00 2001 From: vivek-opsmx Date: Mon, 11 Dec 2023 10:00:44 +0530 Subject: [PATCH] used placeholders instead of concatenation in Log message's --- .../spinnaker/gate/audit/AuthenticationAuditListener.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gate-web/src/main/java/com/opsmx/spinnaker/gate/audit/AuthenticationAuditListener.java b/gate-web/src/main/java/com/opsmx/spinnaker/gate/audit/AuthenticationAuditListener.java index f3b86e79f6..ca36d70d5d 100644 --- a/gate-web/src/main/java/com/opsmx/spinnaker/gate/audit/AuthenticationAuditListener.java +++ b/gate-web/src/main/java/com/opsmx/spinnaker/gate/audit/AuthenticationAuditListener.java @@ -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; } @@ -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)); @@ -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();