Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-316

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

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: 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>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nachbarslumpi Dominik Psenner
                Reporter:
                roy@sohotech.biz Roy Chastain
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: