Click or drag to resize

LogFactoryGetLoggerT Method (String)

Gets the specified named logger. 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 GetLogger<T>(
	string name
)
where T : new(), Logger

Parameters

name
Type: SystemString
Name of the logger.

Type Parameters

T
Type of the logger

Return Value

Type: T
The logger reference with type T. Multiple calls to GetLogger with the same argument are not guaranteed to return the same logger reference.
See Also