Click or drag to resize

LayoutFromMethod Method

Create a SimpleLayout from a lambda method.

Namespace:  NLog.Layouts
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public static Layout FromMethod(
	Func<LogEventInfo, Object> layoutMethod,
	LayoutRenderOptions options = LayoutRenderOptions.None
)

Parameters

layoutMethod
Type: SystemFuncLogEventInfo, Object
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: Layout
Instance of SimpleLayout.
See Also