@ExceptionHandler(Throwable.class)
	@ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR)
	public ResponseEntity<Problem> problem(final Throwable e) {
		String message = "Problem occured";
		UUID uuid = UUID.randomUUID();
		String logRef = uuid.toString();
		logger.error("logRef=" + logRef, message, e);
		return new ResponseEntity<Problem>(new Problem(logRef, message), HttpStatus.INTERNAL_SERVER_ERROR);
	}
Note use base class if you wish to leverage its handling.
Some code will need changing.
springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api/v30/app112/GlobalControllerAdvice.java