Log4net
  1. Log4net
  2. LOG4NET-316

Provide a Layout Pattern that is re-evaluated on each use

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.11
    • Fix Version/s: 1.2.12
    • Component/s: Other
    • Labels:

      Description

      The DynamicPatternLayout is a layout pattern that is re-evaluated on each use. It is appropriate to use instead of LayoutPattern to provide dynamic strings in headers and footers for appenders. Datetime is an example. Using the standard layout pattern results in the same datetime in each header and footer, while using DynamicPatternLayout results in timestamp of the header/footer creation.

      Example
      <layout type="log4net.Layout.DynamicPatternLayout">
      <param name="Header" value="%newline**** Trace Opened Local: %date

      {yyyy-MM-dd HH:mm:ss.fff}

      UTC: %utcdate

      {yyyy-MM-dd HH:mm:ss.fff}

      ****%newline"/>
      <param name="Footer" value="**** Trace Closed %date

      {yyyy-MM-dd HH:mm:ss.fff}

      ****%newline"/>
      </layout>

        Issue Links

          Activity

          Roy Chastain created issue -
          Roy Chastain made changes -
          Field Original Value New Value
          Attachment DynamicPatternLayout.cs [ 12504503 ]
          Stefan Bodewig made changes -
          Fix Version/s 1.2.12 [ 12318546 ]
          Dominik Psenner made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Dominik Psenner [ nachbarslumpi ]
          Resolution Fixed [ 1 ]
          Dominik Psenner made changes -
          Link This issue is duplicated by LOG4NET-346 [ LOG4NET-346 ]

            People

            • Assignee:
              Dominik Psenner
              Reporter:
              Roy Chastain
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development