Click or drag to resize

LogManagerGetCurrentClassLogger 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 LogFactory.GetCurrentClassLogger<T>(). Marked obsolete on NLog 5.2")]
public static Logger GetCurrentClassLogger(
	Type loggerType
)

Parameters

loggerType
Type: SystemType
The logger class. This class must inherit from Logger.

Return Value

Type: Logger
The logger of type loggerType.
Remarks
This is a slow-running method. Make sure you're not doing this in a loop.
See Also