 | 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
)
<ObsoleteAttribute("Replaced by GetCurrentClassLogger<T>(). Marked obsolete on NLog 5.2")>
Public Function GetCurrentClassLogger (
loggerType As Type
) As Logger
Dim instance As LogFactory
Dim loggerType As Type
Dim returnValue As Logger
returnValue = instance.GetCurrentClassLogger(loggerType)
[<ObsoleteAttribute("Replaced by GetCurrentClassLogger<T>(). Marked obsolete on NLog 5.2")>]
member GetCurrentClassLogger :
loggerType : Type -> Logger
Parameters
- loggerType
- Type: SystemType
The type of the logger to create. The type must inherit from Logger
Return Value
Type:
LoggerThe logger of type
loggerType.
RemarksThis method introduces performance hit, because of StackTrace capture.
Make sure you are not calling this method in a loop.
See Also