Add guard around logger.debug statement

The log message involves string concatenation, the cost of which should only be incurred if debug logging is enabled
This commit is contained in:
Craig Andrews 2021-04-16 11:59:01 -04:00 committed by Josh Cummings
parent a31a855146
commit 7dc4de05b1
1 changed files with 3 additions and 1 deletions

View File

@ -52,7 +52,9 @@ public final class SimpleRedirectInvalidSessionStrategy implements InvalidSessio
@Override
public void onInvalidSessionDetected(HttpServletRequest request, HttpServletResponse response) throws IOException {
this.logger.debug("Starting new session (if required) and redirecting to '" + this.destinationUrl + "'");
if (this.logger.isDebugEnabled()) {
this.logger.debug("Starting new session (if required) and redirecting to '" + this.destinationUrl + "'");
}
if (this.createNewSession) {
request.getSession();
}