Explorar o código

日志格式修改

wangmh %!s(int64=7) %!d(string=hai) anos
pai
achega
27c7bdafb1

+ 2 - 2
sso-server/src/main/java/com/uas/sso/web/advice/ExceptionHandlerAdvice.java

@@ -28,7 +28,7 @@ public class ExceptionHandlerAdvice {
 	 */
 	@ExceptionHandler(RuntimeException.class)
 	public ResponseEntity<ModelMap> handleRuntimeException(RuntimeException ex) {
-		logger.error("RuntimeException", ex);
+        logger.warn("{}: {}", ex.getClass().getName(), ex.getMessage());
 		HttpHeaders headers = new HttpHeaders();
 		headers.add("Content-Type", "application/json; charset=utf-8");
 		return new ResponseEntity<ModelMap>(error(ex.getMessage()), headers, HttpStatus.OK);
@@ -42,7 +42,7 @@ public class ExceptionHandlerAdvice {
 	 */
 	@ExceptionHandler(VisibleError.class)
 	public ResponseEntity<ModelMap> handleVisibleError(VisibleError ex) {
-        logger.warn("VisibleError", ex.getMessage());
+        logger.warn("{}: {}", ex.getClass().getName(), ex.getMessage());
 		HttpHeaders headers = new HttpHeaders();
 		headers.add("Content-Type", "application/json; charset=utf-8");
 		return new ResponseEntity<ModelMap>(error(ex.getMessage()), headers, HttpStatus.OK);