United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6285131 : java.util.logging.SimpleFormatter should be configurable to output milliseconds

Details
Type:
Enhancement
Submit Date:
2005-06-14
Status:
Closed
Updated Date:
2012-01-24
Project Name:
JDK
Resolved Date:
2005-07-27
Component:
core-libs
OS:
linux
Sub-Component:
java.util.logging
CPU:
x86
Priority:
P4
Resolution:
Future Project
Affected Versions:
5.0
Fixed Versions:

Related Reports

Sub Tasks

Description
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

                                    

Comments



Hardware and Software, Engineered to Work Together