Skip to content
This repository was archived by the owner on May 31, 2022. It is now read-only.

Commit 7118946

Browse files
jbibliojgrandja
authored andcommitted
Log generic Exceptions to ERROR with stack trace
Log Exceptions to ERROR. Protocol Exceptions are treated in separate ExceptionHandlers, but generic Exceptions like NPEs must be logged with full stack trace Fixes gh-1545
1 parent e80eefd commit 7118946

File tree

1 file changed

+2
-2
lines changed
  • spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/endpoint

1 file changed

+2
-2
lines changed

spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/endpoint/TokenEndpoint.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ public ResponseEntity<OAuth2Exception> handleHttpRequestMethodNotSupportedExcept
165165

166166
@ExceptionHandler(Exception.class)
167167
public ResponseEntity<OAuth2Exception> handleException(Exception e) throws Exception {
168-
if (logger.isWarnEnabled()) {
169-
logger.warn("Handling error: " + e.getClass().getSimpleName() + ", " + e.getMessage());
168+
if (logger.isErrorEnabled()) {
169+
logger.error("Handling error: " + e.getClass().getSimpleName() + ", " + e.getMessage(), e);
170170
}
171171
return getExceptionTranslator().translate(e);
172172
}

0 commit comments

Comments
 (0)