| LogFactoryGetCurrentClassLoggerT Method |
Gets the logger with the full name of the current class, so namespace and class name.
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 GetCurrentClassLogger<T>()
where T : new(), Logger
Public Function GetCurrentClassLogger(Of T As {New, Logger}) As T
Dim instance As LogFactory
Dim returnValue As T
returnValue = instance.GetCurrentClassLogger()
member GetCurrentClassLogger : unit -> 'T when 'T : new() and Logger
Type Parameters
- T
- Type of the logger
Return Value
Type:
TThe logger with type
T.
Remarks This method introduces performance hit, because of StackTrace capture.
Make sure you are not calling this method in a loop.
See Also