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.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
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