package de.digitalcollections.iiif.presentation.frontend.impl.springmvc.controller.v2;

import de.digitalcollections.iiif.presentation.model.api.exceptions.NotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;

@ControllerAdvice
public class ExceptionAdvice {
  @ResponseStatus(HttpStatus.NOT_FOUND)
  @ExceptionHandler(NotFoundException.class)
  public void handleNotFound() {
  }

  @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
  @ExceptionHandler(Exception.class)
  public void handleAllOther() {
  }
}

@@ -168,16 +168,73 @@
 eption;%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 import o
@@ -269,16 +269,16 @@
 Status;%0A
-
 import o
@@ -512,16 +512,105 @@
 dvice %7B%0A
+%0A  private static final Logger LOGGER = LoggerFactory.getLogger(ExceptionAdvice.class);%0A%0A
   @Respo
@@ -842,18 +842,91 @@
 llOther(
-) %7B
+Exception exception) %7B%0A    LOGGER.error(%22exception stack trace%22, exception);
 %0A  %7D%0A%7D%0A

Add exception logging