You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Eric Chamberlain <ec...@ventripoint.com> on 2008/06/28 00:33:41 UTC
Default PatternLayout date format is not ISO8601
I could find no FAQ on this so I am reporting this here. Everyone repeats that
%date{ISO8601} will produce ISO8601 format for dates. Beyond that, the documentation says
that the default form of the %date in PatternLayout is ISO8601.
This appears to be wrong based on the statement of the ISO8601 standard at
http://www.w3.org/TR/NOTE-datetime.
An example should illustrate the difference easily.
Sample output of %date{ISO8601}:
2008-06-27 15:24:27,421
But if the above elements (down to the fractional second) are to be displayed, the ISO8601
standard says it should be (assuming Pacific Time in this sample)
2008-06-27T15:24:27.421-07:00
The ISO8601 correct format is *possible* in log4net, of course, but it is not the default.
I don't know whether this is a bug in log4net or whether the documentation is just out of
date or what. I will leave that for others to sort out but there is a mismatch between
the documentation and the behavior.
Eric Chamberlain
VentriPoint, Inc. | www.ventripoint.com | Software Engineer
Helping heart care through innovative diagnostic solutions