Bug 64190 - OneLineFormatter always add milliseconds at the end of timestamp
Summary: OneLineFormatter always add milliseconds at the end of timestamp
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: JULI (show other bugs)
Version: 8.5.x-trunk
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-03 01:20 UTC by Thien Bui
Modified: 2020-03-03 14:42 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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