| LogFactoryGetLoggerT Method (String) |
Gets the specified named logger.
Use
T to create instance of a custom
Logger.
If you haven't defined your own
Logger class, then use the overload without the type parameter.
Namespace:
NLog
Assembly:
NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax public T GetLogger<T>(
string name
)
where T : new(), Logger
Public Function GetLogger(Of T As {New, Logger}) (
name As String
) As T
Dim instance As LogFactory
Dim name As String
Dim returnValue As T
returnValue = instance.GetLogger(name)
member GetLogger :
name : string -> 'T when 'T : new() and Logger
Parameters
- name
- Type: SystemString
Name of the logger.
Type Parameters
- T
- Type of the logger
Return Value
Type:
TThe logger reference with type
T. Multiple calls to
GetLogger with the same argument
are not guaranteed to return the same logger reference.
See Also