File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
web/src/main/java/org/springframework/security/web/access Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 33import jakarta .servlet .ServletException ;
44import jakarta .servlet .http .HttpServletRequest ;
55import jakarta .servlet .http .HttpServletResponse ;
6+ import org .apache .commons .logging .Log ;
7+ import org .apache .commons .logging .LogFactory ;
8+ import org .springframework .core .log .LogMessage ;
69import org .springframework .http .HttpStatus ;
710import org .springframework .security .access .AccessDeniedException ;
811import org .springframework .util .Assert ;
1114
1215public class HttpStatusAccessDeniedHandler implements AccessDeniedHandler {
1316
17+ protected static final Log logger = LogFactory .getLog (HttpStatusAccessDeniedHandler .class );
18+
1419 private final HttpStatus httpStatus ;
1520
1621 public HttpStatusAccessDeniedHandler (HttpStatus httpStatus ) {
@@ -21,6 +26,8 @@ public HttpStatusAccessDeniedHandler(HttpStatus httpStatus) {
2126 @ Override
2227 public void handle (HttpServletRequest request , HttpServletResponse response ,
2328 AccessDeniedException accessDeniedException ) throws IOException , ServletException {
29+ logger .debug (LogMessage .format ("Access denied with status code %d" , this .httpStatus .value ()));
30+
2431 response .sendError (this .httpStatus .value (), "Access Denied" );
2532 }
2633
You can’t perform that action at this time.
0 commit comments