It was indeed a matter of properly configuring the formatter for log records.
As the manual says, the throwable is the 6th parameter of the method format. So I added %6$s
to my format in logging.properties:
java.util.logging.SimpleFormatter.format=%1$tT,%1$tN [%4$s]%3$s: %5$s %6$s %n
And here is the output, showing the stack trace:
17:29:33,314000000 [SEVERE]simplelogger: Failed to format Hello world
java.lang.NumberFormatException: For input string: "Hello world"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.valueOf(Integer.java:582)
at com.aed.tests.logging.TestLogging.main(TestLogging.java:15)
17:29:33,344000000 [SEVERE]simplelogger: Without parametrized string
java.lang.NumberFormatException: For input string: "Hello world"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.valueOf(Integer.java:582)
at com.aed.tests.logging.TestLogging.main(TestLogging.java:15)