| LayoutTypedExtensionsRenderValueT Method |
Renders the logevent into a result-value by using the provided layout
Namespace:
NLog
Assembly:
NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax public static T RenderValue<T>(
this Layout<T> layout,
LogEventInfo logEvent,
T defaultValue = null
)
<ExtensionAttribute>
Public Shared Function RenderValue(Of T) (
layout As Layout(Of T),
logEvent As LogEventInfo,
Optional defaultValue As T = Nothing
) As T
Dim layout As Layout(Of T)
Dim logEvent As LogEventInfo
Dim defaultValue As T
Dim returnValue As T
returnValue = layout.RenderValue(logEvent,
defaultValue)
[<ExtensionAttribute>]
static member RenderValue :
layout : Layout<'T> *
logEvent : LogEventInfo *
?defaultValue : 'T
(* Defaults:
let _defaultValue = defaultArg defaultValue null
*)
-> 'T
Parameters
- layout
- Type: NLog.LayoutsLayoutT
The layout. - logEvent
- Type: NLogLogEventInfo
The logevent info. - defaultValue (Optional)
- Type: T
Fallback value when no value available
Type Parameters
- T
Return Value
Type:
TResult value when available, else fallback to defaultValue
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
LayoutT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks See Also