Skip to main content

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
TypeNameDescription
LogTypedefaultLogLevel
Returns
TypeDescription
ILogger

GetLogger(Type, LogType)

Declaration
public static ILogger GetLogger(Type type, LogType defaultLogLevel = null)
Parameters
TypeNameDescription
System.Typetype
LogTypedefaultLogLevel
Returns
TypeDescription
ILogger

GetLogger(String, LogType)

Declaration
public static ILogger GetLogger(string loggerName, LogType defaultLogLevel = null)
Parameters
TypeNameDescription
System.StringloggerName
LogTypedefaultLogLevel
Returns
TypeDescription
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
TypeNameDescription
ILogHandlerlogHandler
System.BooleanreplaceExisting

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
TypeNameDescription
System.Func<System.String, ILogHandler>createHandler
System.BooleanreplaceExisting