Bug 64190

Summary: OneLineFormatter always add milliseconds at the end of timestamp
Product: Tomcat 8 Reporter: Thien Bui <thienbui797>
Component: JULIAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: 8.5.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: All   

Description Thien Bui 2020-03-03 01:20:02 UTC
I have looked into the code.
OneLineFormatter always add miliseconds to the end of log timestamp which is very inconvenient since ISO 8601 has timezone at the end.
I ended up with timestamp like this:
2020-03-03T12:12:06.000000+1100.071

I want to ether have the milliseconds in with solution described in https://bz.apache.org/bugzilla/show_bug.cgi?id=59871#c11 or having a configure property to let me stop adding miliseconds to the end of the timestamp

I can help out with the fix if the developer team doesn't have resource to fix this. Just need to tell me which direction is prefered
Comment 1 Christopher Schultz 2020-03-03 13:58:00 UTC
This might be difficult, due to the way the OneLineFormatter caches DateFormat objects and only updates the "time" every 1000ms.

Whatever solution you come up with needs to maintain the existing performance characteristics of the OneLineFormatter.
Comment 2 Mark Thomas 2020-03-03 13:59:49 UTC
I have a patch ready that does this.
Comment 3 Mark Thomas 2020-03-03 14:42:21 UTC
Fixed in:
- master for 10.0.0-M2 onwards
- 9.0.x for 9.0.32 onwards
- 8.5.x for 8.5.52 onwards
- 7.0.x for 7.0.101 onwards