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.1+cf6675da40ccfd4c8c526a3b2bdbeed3442910a1
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
Tell if method is safe for concurrent threading.

Return Value

Type: Layout
Instance of SimpleLayout.
See Also