RFR: 8303198: System and Runtime.exit() resilience to logging errors [v2]

Chris Hegarty chegar at openjdk.org
Wed Mar 1 17:17:12 UTC 2023


On Tue, 28 Feb 2023 14:09:50 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> But does that logging include the thread identity? If multiple threads can race to exit and all log, then the developer/user needs to know which logging came from which thread.
>
>> But does that logging include the thread identity? If multiple threads can race to exit and all log, then the developer/user needs to know which logging came from which thread.
> 
> That's really up to the Logger and its configuration. If j.u.logging is used then formatters can be configured to put the thread ID into the log records. With 3rd party logging libraries there seems to be several choices, like %t for the thread name.
> 
> The main usage for this logging is to be able to find code in tests, plugins, etc. that is calling System.exit and causing the test runner or container to exit. So I think it's less about "which thread" and more about "which code".

System.Logger is a facade for arbitrary user-code, commonly the log4J bridge. I routinely observe log4J throwing SecurityException's from deep within its implementation (since it is only partially implemented to handle the security manager)

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

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


More information about the core-libs-dev mailing list