Skip to content

Commit

Permalink
Fix incorrect log formatting in DruidKerberosAuthenticationHandler. (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
gianm authored and jon-wei committed Sep 18, 2017
1 parent c2a0e75 commit 96612cc
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ public void init(Properties config) throws ServletException
}

for (String spnegoPrincipal : spnegoPrincipals) {
log.info("Login using keytab {}, for principal {}",
keytab, spnegoPrincipal
);
log.info("Login using keytab %s, for principal %s", keytab, spnegoPrincipal);
final KerberosAuthenticator.DruidKerberosConfiguration kerberosConfiguration =
new KerberosAuthenticator.DruidKerberosConfiguration(keytab, spnegoPrincipal);
final LoginContext loginContext =
Expand All @@ -117,7 +115,7 @@ public void init(Properties config) throws ServletException
loginContext.login();
}
catch (LoginException le) {
log.warn(le, "Failed to login as [{}]", spnegoPrincipal);
log.warn(le, "Failed to login as [%s]", spnegoPrincipal);
throw new AuthenticationException(le);
}
loginContexts.add(loginContext);
Expand Down Expand Up @@ -201,7 +199,7 @@ public AuthenticationToken run() throws Exception
String userName = kerberosName.getShortName();
token = new AuthenticationToken(userName, clientPrincipal, getType());
response.setStatus(HttpServletResponse.SC_OK);
log.trace("SPNEGO completed for principal [{}]", clientPrincipal);
log.trace("SPNEGO completed for principal [%s]", clientPrincipal);
}
}
finally {
Expand Down

0 comments on commit 96612cc

Please sign in to comment.