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
UTC: %utcdate
{yyyy-MM-dd HH:mm:ss.fff} ****%newline"/>
<param name="Footer" value="**** Trace Closed %date
****%newline"/>
</layout>
Attachments
Attachments
Issue Links
- is duplicated by
-
LOG4NET-346 write time not change
- Resolved