Click or drag to resize

LayoutTFromMethod Method

Create a typed layout from a lambda method.

Namespace:  NLog.Layouts
Assembly:  NLog (in NLog.dll) Version: 5.5.0+1873145cbc26e0312d9481234d69ce7dc68aac4e
Syntax
public static Layout<T> FromMethod(
	Func<LogEventInfo, T> layoutMethod,
	LayoutRenderOptions options = LayoutRenderOptions.None
)

Parameters

layoutMethod
Type: SystemFuncLogEventInfo, T
Method that renders the layout.
options (Optional)
Type: NLog.LayoutsLayoutRenderOptions
Whether method is ThreadAgnostic and doesn't depend on context of the logging application thread.

Return Value

Type: LayoutT
Instance of typed layout.
See Also