Click or drag to resize

LogFactoryGetCurrentClassLogger Method (Type)

Note: This API is now obsolete.

Gets a custom logger with the full name of the current class, so namespace and class name. Use loggerType to create instance of a custom Logger. If you haven't defined your own Logger class, then use the overload without the loggerType.

Namespace:  NLog
Assembly:  NLog (in NLog.dll) Version: 5.2.0+eed5f76d158dbcaef9326f7a0e1c281adad171e8
Syntax
[ObsoleteAttribute("Replaced by GetCurrentClassLogger<T>(). Marked obsolete on NLog 5.2")]
public Logger GetCurrentClassLogger(
	Type loggerType
)

Parameters

loggerType
Type: SystemType
The type of the logger to create. The type must inherit from Logger

Return Value

Type: Logger
The logger of type loggerType.
Remarks
This method introduces performance hit, because of StackTrace capture. Make sure you are not calling this method in a loop.
See Also