Better tools for adjusting to strong encapsulation

Simon Nash simon at
Fri Mar 24 08:08:46 UTC 2017

On 23/03/2017 19:04, Alan Bateman wrote:
> On 23/03/2017 18:44, Alan Snyder wrote:
>> If I understand JEP 264 correctly, it should be possible to direct 
>> platform generated error messages to locations other than the standard 
>> error stream (System.err).
>> Is that correct?
>> If so, would it not make sense for the default to be the (platform 
>> dependent) console log rather than System.err, which is used by 
>> applications for their own error messages?
> System.Logger can be configured to send log messages to whatever logging 
> library you are using. However, is is not appropriate here, ditto for 
> several other areas where you don't want arbitrary code to execute.
> -Alan
Would it be possible for the JDK to include a small number of predefined
Logger instances that provide alternative destinations for these messages?
For example, there could be a logger for System.err, a logger for the
platform console (where applicable) and a logger that directs output to
a user-specified file.  This approach would provide some flexibility for
the developer without allowing arbitrary code to execute.


More information about the jigsaw-dev mailing list