Apache log4net� SDK Documentation - Microsoft .NET Framework 4.0

DynamicPatternLayout Class

A flexible layout configurable with pattern string that re-evaluates on each call.

For a list of all members of this type, see DynamicPatternLayout Members.


public�class�DynamicPatternLayout : PatternLayout

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


This class is built on PatternLayout and provides all the features and capabilities of PatternLayout. PatternLayout is a 'static' class in that its layout is done once at configuration time. This class will recreate the layout on each reference.

One important difference between PatternLayout and DynamicPatternLayout is the treatment of the Header and Footer parameters in the configuration. The Header and Footer parameters for DynamicPatternLayout must be syntactically in the form of a PatternString, but should not be marked as type log4net.Util.PatternString. Doing so causes the pattern to be statically converted at configuration time and causes DynamicPatternLayout to perform the same as PatternLayout.

Please see PatternLayout for complete documentation.

<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>


Namespace: log4net.Layout

Assembly: log4net (in log4net.dll)

See Also

DynamicPatternLayout Members | log4net.Layout Namespace