Click or drag to resize

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.5.0+1873145cbc26e0312d9481234d69ce7dc68aac4e
Syntax
public T GetCurrentClassLogger<T>()
where T : new(), Logger

Type Parameters

T
Type of the logger

Return Value

Type: T
The 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