diff --git a/src/main/java/com/ddf/vodsystem/controllers/GlobalExceptionHandler.java b/src/main/java/com/ddf/vodsystem/controllers/GlobalExceptionHandler.java index 79fa6bd..12234f7 100644 --- a/src/main/java/com/ddf/vodsystem/controllers/GlobalExceptionHandler.java +++ b/src/main/java/com/ddf/vodsystem/controllers/GlobalExceptionHandler.java @@ -23,56 +23,56 @@ public class GlobalExceptionHandler { @ExceptionHandler({ MultipartException.class }) public ResponseEntity> handleMultipartException(MultipartException ex) { - logger.error("MultipartException: {}", ex.getMessage(), ex); + logger.error("MultipartException: {}", ex.getMessage()); APIResponse response = new APIResponse<>(ERROR, "Multipart request error: " + ex.getMessage(), null); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response); } @ExceptionHandler({ MissingServletRequestPartException.class }) public ResponseEntity> handleMissingPart(MissingServletRequestPartException ex) { - logger.error("MissingServletRequestPartException: {}", ex.getMessage(), ex); + logger.error("MissingServletRequestPartException: {}", ex.getMessage()); APIResponse response = new APIResponse<>(ERROR, "Required file part is missing.", null); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response); } @ExceptionHandler({ HttpMediaTypeNotSupportedException.class }) public ResponseEntity> handleUnsupportedMediaType(HttpMediaTypeNotSupportedException ex) { - logger.error("HttpMediaTypeNotSupportedException: {}", ex.getMessage(), ex); + logger.error("HttpMediaTypeNotSupportedException: {}", ex.getMessage()); APIResponse response = new APIResponse<>(ERROR, "Unsupported media type: expected multipart/form-data.", null); return ResponseEntity.status(HttpStatus.UNSUPPORTED_MEDIA_TYPE).body(response); } @ExceptionHandler(IllegalArgumentException.class) public ResponseEntity> handleIllegalArgument(IllegalArgumentException ex) { - logger.error("IllegalArgumentException: {}", ex.getMessage(), ex); + logger.error("IllegalArgumentException: {}", ex.getMessage()); APIResponse response = new APIResponse<>(ERROR, ex.getMessage(), null); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response); } @ExceptionHandler(JobNotFound.class) public ResponseEntity> handleFileNotFound(JobNotFound ex) { - logger.error("JobNotFound: {}", ex.getMessage(), ex); + logger.error("JobNotFound: {}", ex.getMessage()); APIResponse response = new APIResponse<>(ERROR, ex.getMessage(), null); return ResponseEntity.status(HttpStatus.NOT_FOUND).body(response); } @ExceptionHandler(JobNotFinished.class) public ResponseEntity> handleJobNotFinished(JobNotFinished ex) { - logger.error("JobNotFinished: {}", ex.getMessage(), ex); + logger.error("JobNotFinished: {}", ex.getMessage()); APIResponse response = new APIResponse<>(ERROR, ex.getMessage(), null); return ResponseEntity.status(HttpStatus.ACCEPTED).body(response); } @ExceptionHandler(FFMPEGException.class) public ResponseEntity> handleFFMPEGException(FFMPEGException ex) { - logger.error("FFMPEGException: {}", ex.getMessage(), ex); + logger.error("FFMPEGException: {}", ex.getMessage()); APIResponse response = new APIResponse<>(ERROR, "FFMPEG Error: Please upload a valid file", null); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response); } @ExceptionHandler(NotAuthenticated.class) public ResponseEntity> handleNotAuthenticated(NotAuthenticated ex) { - logger.error("NotAuthenticated: {}", ex.getMessage(), ex); + logger.error("NotAuthenticated: {}", ex.getMessage()); APIResponse response = new APIResponse<>(ERROR, "User is not authenticated", null); return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(response); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 6fc6bca..51bb1cf 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -10,6 +10,3 @@ storage.outputs=videos/clips/ ## Server Configuration server.servlet.session.timeout=30m - -# Logging -logging.level.org.springframework.web=DEBUG \ No newline at end of file