A DESCRIPTION OF THE REQUEST :
Currently the constructor of LogRecord uses a ThreadLocal to maintain an id for the thread which creates the record.
LogRecord should use java.lang.Thread.currentThread().getID() instead. The Thread class uses a linear incremented long value while LogRecord uses an int. However, overflow will happen nearly never, and could also happen the way LogRecord creates the id.
Additionally, for performance purposes LogRecord should not use a synchronized statement but an atomic operation to keep the internal counter (private static sequenceNumber) in sync.
For debugging purposes I need the real thread id. The id provided by LogRecord is nearly useless.
E.g. seeing the real thread id I can associate the worker thread of a client-server connection with the log records without printing info about the thread each time.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Formatters displaying LogRecord.getThreadID() should show the thread id as provided by java.lang,Thread.getID()
Actually LogRecord maintains a thread counter for itself and it does it somewhat slowly.
CUSTOMER SUBMITTED WORKAROUND :
Overwrite LogRecord and do it yourself. However, there is no way to solve the (minor) performance issue of the LogRecord constructor.
###@###.### 2005-05-31 06:00:17 GMT