Class LoggingProvider
The static class provides an easy-to-use API to inject the
Inheritance
Namespace: TeleScope.Logging
Assembly: TeleScope.Logging.dll
Syntax
public static class LoggingProvider : object
Methods
| Improve this Doc View SourceCreateLogger(String)
Get a logger from the internal logger factory and use a name to tag the source.
Declaration
public static ILogger CreateLogger(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name tags the source of the log messages. |
Returns
Type | Description |
---|---|
ILogger | The concrete logger. |
CreateLogger(Type)
Get a logger from the internal logger factory and use a
Declaration
public static ILogger CreateLogger(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type tags the source of the log messages. |
Returns
Type | Description |
---|---|
ILogger | The concrete logger. |
CreateLogger<T>()
Get a logger from the internal logger factory and use a generic type to tag the source.
Declaration
public static ILogger<T> CreateLogger<T>()
Returns
Type | Description |
---|---|
ILogger<T> | The concrete logger. |
Type Parameters
Name | Description |
---|---|
T | The generic type T tags the source of the log messages. |
Initialize(ILoggerFactory)
Stores the given logger factory that provides loggers via the provided CreateLogger
methods.
If the parameter is null the
Declaration
public static void Initialize(ILoggerFactory loggerFactory)
Parameters
Type | Name | Description |
---|---|---|
ILoggerFactory | loggerFactory | The logger factory that will provide concrete loggers. |