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

Issue gh-9648
This commit is contained in:
Craig Andrews 2021-04-16 11:59:01 -04:00 committed by Josh Cummings
parent 6c5e92fb0b
commit a85ce9c91f
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
1 changed files with 4 additions and 2 deletions

View File

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