Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6381464

SimpleFormatter should use one single line format

XMLWordPrintable

    • b138
    • generic, x86
    • generic, windows_xp
    • Verified

      A DESCRIPTION OF THE REQUEST :
      Default Java Logging Format uses two lines per log output.. Default logging format should be brief and without line seperators.

      JUSTIFICATION :
      Since default format uses a two line logging output, it is hard to read and follow by the developers. logging output seems cluttured. Although it is possible to define custom Formatters, many third party Java libraries uses the default format of the Java logger and does not bother making a custom formatter (such as Tomcat 5.5.x). i see developers use log4j or other kind of third party logger mechanisms just because default format is ugly.
      Default output first should tell what is the Level and the actual output, the other details (time, class, method) shoud be appended later. Of course the order of the default output format is my personal opininon..

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Default Java looger format it should be single line.

      ACTUAL -
      Formatter uses two lines per log output. Output seems confusing.

      ---------- BEGIN SOURCE ----------
      package com.myCompany.project;

      import java.util.logging.Logger;

      public class DefaultLoggerTest {

          public static void main(String[] args) {
              Logger logger = Logger.getLogger(DefaultLoggerTest.class.getName());
              logger.info("Testing default format..");
          }
      }

      output:

      Feb 3, 2006 11:40:39 PM com.myCompany.project.DefaultLoggerTest main
      INFO: Testing default format..

      can be shown in one such as like this (something better, or more brief can be written, this is just an example)

      INFO: Testing default format.. [DefaultLoggerTest | main | Feb 3, 2006 11:40:39 PM | com.myCompany.project]
      ---------- END SOURCE ----------
      This bug fix adds the following new SDK/JDK test:

          java/util/logging/SimpleFormatterFormat.java

      This test is not valid for execution until JDK7-B138.
      If this test is executed on older bits, it will fail.
      However, this entry will make that failure appear on
      the known fail_list.

            mchung Mandy Chung (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: