On 3/9/11 3:47 AM, Alan Bateman wrote:
Mandy Chung wrote:
7006814: sun.util.logging.PlatformLogger ability to override the output format

The platform logger is using the SimpleFormatter to be same as the default logging configuration. It prints 2 lines with the timestamp. For debugging use, 1-line format will be simpler and adequate. The number of lines output will be half. This fix allows to switch to 1-line format by setting "sun.util.logging.oneLineFormat" system property as an interim solution before 6381464 is fixed.

Webrev at:
    http://cr.openjdk.java.net/~mchung/7006814/webrev.00/
It seems a bit strange to have the platform logger support this but not SimpleFormatter. Do you think there would be any compatibility concerns if SimpleFormatter were changed to emit one line output?

As Eamonn said, I don't think we can change the default of SimpleFormatter to one line as it would break existing apps/scripts/tools that depend on the format.
If not then it might be simpler to change it along with the platform logger so that this property isn't needed. If there is a concern then an alternative it to change the platform logger so that it emits the one-line output by default as it's only used in the platform.

When j.u.logging is enabled (e.g. the j.u.logging API is called), it will use the SimpleFormatter as the default. If the platform logger uses one-line format, the output will be inconsistent depending on whether the j.u.logging API is used by the application. Keeping the default same as j.u.logging avoids the confusion.

Mandy

Reply via email to