RFR: 8301627: System.exit and Runtime.exit debug logging

Alan Bateman alanb at openjdk.org
Sun Feb 12 18:33:28 UTC 2023


On Fri, 10 Feb 2023 20:33:39 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> It can be difficult to find the cause of calls to `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java runtime exits.
> The status value and stack trace are logged using the System Logger named `java.lang.Runtime` with message level `System.Logger.Level.DEBUG`.

test/jdk/java/lang/runtime/RuntimeExitLogTest.java line 89:

> 87:         }
> 88:         cmd.add(this.getClass().getName());
> 89:         cmd.add(Integer.toString(status));

Another possibility for testing this is to launch with ` --limit-modules java.base -Djdk.system.logger.level=DEBUG` to use the simple console implementation that is in java.base and avoid needing properties files for j.u.logging. Just mentioning is an option to make it simple.

-------------

PR: https://git.openjdk.org/jdk/pull/12517


More information about the core-libs-dev mailing list