public ResponseEntity exception()

in log4j-spring-cloud-config-sample-application/src/main/java/org/apache/logging/log4j/spring/cloud/config/sample/controller/SampleController.java [87:98]


    public ResponseEntity<String> exception() {
        Throwable t = new Throwable("This is a test");
        LOGGER.info("This is a test", t);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(os);
        t.printStackTrace(ps);
        String stackTrace = os.toString();
        stackTrace = stackTrace.replaceAll("\n", "<br>");

        //LOGGER.info("Hello, World");
        return ResponseEntity.ok(stackTrace);
    }