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.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
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