Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
None
-
irrelevant here
Description
Using the default "%d" "%date" or %d
{ISO8601} does not output a correct ISO 8601 formatted date and time representation.
Indeed there is a space between the date and the time, as the specification says having a space separator means there two fields : a 'date field' and a 'time field'.
The specification consider this as acceptable for human reading though. However when processing logs it might cause some trouble to effectively parse the fields, especially when correlating logs from different applications. For now we have workarounds, but it seems reasonable to have a correct ISO8601 formatting.
The correct ISO8601 representation for a 'date and time field' is to have the T indicator, for example '2007-03-01T13:00:00Z'.
The workaround for now is to write ourself the correct ISO8601 pattern.
Oh and by the way the timezone formatting options in the SimpleDateFormat are incomplete. The JodaTime format class org.joda.time.format.ISODateTimeFormat worth a look on this matter. Anyway date and time related classes in the JDK are not known for being the best at what they do.
This problem is also found in log4j.
An excerpt of the specification is documented on wikipedia.
http://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations
Attachments
Issue Links
- links to