Log4net
  1. Log4net
  2. LOG4NET-323

AbsoluteTimeDateFormatter caches string representation of now too aggressively

    Details

      Description

      The AbsoluteTimeDateFormatter class caches the string representation of the most recent timestamp it has seen, down to the second.

      The problem is, this cache is inherited by other formatter classes, which represent that value in different ways.

      This causes the formatted date/time generated by layouts and thus appended to logs to be inconsistent if there are multiple date/time formats in use in different appenders. For example, I have a debug appender which uses the %date

      {ABSOLUTE}

      format, and a log file appender which uses the %date

      {ISO8601}

      format. Because the debug appender sees most messages first, most (but not all!) entries in the log file get the ABSOLUTE format, even though ISO8601 was specified.

      The cache of the string representation needs to be specific to a particular date format.

        Activity

        Matthew Gabeler-Lee created issue -
        Hide
        Stefan Bodewig added a comment -

        fixed with svn revision 1297194

        Thanks!

        Show
        Stefan Bodewig added a comment - fixed with svn revision 1297194 Thanks!
        Stefan Bodewig made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.2.12 [ 12318546 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        24d 23h 37m 1 Stefan Bodewig 05/Mar/12 19:39

          People

          • Assignee:
            Unassigned
            Reporter:
            Matthew Gabeler-Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development