Skip to content

Commit ab34c03

Browse files
candrewsjzheaux
authored andcommitted
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
1 parent adf3e94 commit ab34c03

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

web/src/main/java/org/springframework/security/web/session/SimpleRedirectInvalidSessionStrategy.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ public SimpleRedirectInvalidSessionStrategy(String invalidSessionUrl) {
4646

4747
public void onInvalidSessionDetected(HttpServletRequest request,
4848
HttpServletResponse response) throws IOException {
49-
logger.debug("Starting new session (if required) and redirecting to '"
50-
+ destinationUrl + "'");
49+
if (logger.isDebugEnabled()) {
50+
logger.debug("Starting new session (if required) and redirecting to '"
51+
+ destinationUrl + "'");
52+
}
5153
if (createNewSession) {
5254
request.getSession();
5355
}

0 commit comments

Comments
 (0)