Class LogFactory
Inheritance
System.Object
Inherited Members
Show
Syntax
public static class LogFactory
Properties
Loggers
Declaration
public static IReadOnlyDictionary<string, ILogger> Loggers { get; }
Methods
GetLogger<T>(LogType)
Declaration
public static ILogger GetLogger<T>(LogType defaultLogLevel = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LogType | defaultLogLevel |
Returns
| Type | Description |
|---|---|
| ILogger |
GetLogger(Type, LogType)
Declaration
public static ILogger GetLogger(Type type, LogType defaultLogLevel = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | |
| LogType | defaultLogLevel |
Returns
| Type | Description |
|---|---|
| ILogger |
GetLogger(String, LogType)
Declaration
public static ILogger GetLogger(string loggerName, LogType defaultLogLevel = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | loggerName | |
| LogType | defaultLogLevel |
Returns
| Type | Description |
|---|---|
| ILogger |
ReplaceLogHandler(ILogHandler, Boolean)
Replacing log handlers for loggers, with the option to replace for exisitng or just new loggers
Declaration
public static void ReplaceLogHandler(ILogHandler logHandler, bool replaceExisting = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogHandler | logHandler | |
| System.Boolean | replaceExisting |
ReplaceLogHandler(Func<String, ILogHandler>, Boolean)
Replaceing log handlers for loggers, allows for unique log handlers for each type this can be used to add labels or other processing before logging the result
Declaration
public static void ReplaceLogHandler(Func<string, ILogHandler> createHandler, bool replaceExisting = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.String, ILogHandler> | createHandler | |
| System.Boolean | replaceExisting |