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

java.util.logging.SimpleFormatter should be configurable to output milliseconds

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Future Project
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs

      A DESCRIPTION OF THE REQUEST :
      There does not seem to be any way to make java.util.logging.SimpleFormatter output
      the LogRecord time in milliseconds.


      JUSTIFICATION :
      Many applications require knowing when something happened with better than one second precision.

      This functionality is so widely useful that it should be in the standard logging classes -
      I should not have to find or write another class to do it.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would like to be able to generate log entries like this:

      Jun 11, 2005 5:34:11.123 PM TestLogger main
      INFO: testing

      or this:

      11/06/2005 16:35:27.123 TestLogger main
      INFO: testing


      ACTUAL -
      I can only log this:

      Jun 11, 2005 5:34:11 PM TestLogger main
      INFO: testing

      (no milliseconds)

      or this:

      11/06/2005 16:35:27 TestLogger main
      INFO: testing

      (again no milliseconds)


      ---------- BEGIN SOURCE ----------
      import java.util.logging.*;


      public class TestLogger
      {
         static public void main( String[] args )
         {
            Logger.global.info( "testing" );
         }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      write my own class that extends java.util.logging.Formatter
      ###@###.### 2005-06-14 09:20:44 GMT

            Unassigned Unassigned
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: