Click or drag to resize

LayoutTFromMethod Method

Create a typed layout from a lambda method.

Namespace:  NLog.Layouts
Assembly:  NLog (in NLog.dll) Version: 6.0.0+cfb73701cda54e2410b006f649f072e90daef707
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