C# Class Hawkeye.Logging.log4net.Log4NetServiceFactory

This class allows for the creation of a trace service instance based on the log4net framework.
Inheritance: ILogServiceFactory, ILogServiceAppendable
Mostrar archivo Open project: odalet/Hawkeye2 Class Usage Examples

Private Properties

Property Type Description
ConfigureLog4Net void
CreateService ILogService
GetEntryAssembly System.Reflection.Assembly
GetRootLogger global::log4net.Core.ILogger
InitializeApplicationName string

Public Methods

Method Description
AppendLogService ( ILogService logService, object>.IDictionary additionalData = null ) : ILogLevelThresholdSelector

Appends the specified log service to a root log service (the current instance).

GetLogger ( Type type, object>.IDictionary additionalData = null ) : ILogService

Obtains an instance of the logger service for the specified type and optional additional data.

Log4NetServiceFactory ( ) : System

Initializes a new instance of the Log4NetServiceFactory class.

Log4NetServiceFactory ( string configFile ) : System

Initializes a new instance of the Log4NetServiceFactory class.

Shutdown ( ) : void

Closes all the resources held by the various loggers.

Private Methods

Method Description
ConfigureLog4Net ( string filename ) : void
CreateService ( Type type ) : ILogService

Creates the logging service and return the newly created instance.

The configuration file used by log4net will be the application's configuration file (web.config ou app.exe.config) which will have to contain a <log4net> section.

GetEntryAssembly ( ) : Assembly
GetRootLogger ( ) : global::log4net.Core.ILogger
InitializeApplicationName ( ) : string

Method Details

AppendLogService() public method

Appends the specified log service to a root log service (the current instance).
public AppendLogService ( ILogService logService, object>.IDictionary additionalData = null ) : ILogLevelThresholdSelector
logService ILogService The log service.
additionalData object>.IDictionary The optional additional data.
return ILogLevelThresholdSelector

GetLogger() public method

Obtains an instance of the logger service for the specified type and optional additional data.
public GetLogger ( Type type, object>.IDictionary additionalData = null ) : ILogService
type System.Type The type.
additionalData object>.IDictionary The additional data.
return ILogService

Log4NetServiceFactory() public method

Initializes a new instance of the Log4NetServiceFactory class.
public Log4NetServiceFactory ( ) : System
return System

Log4NetServiceFactory() public method

Initializes a new instance of the Log4NetServiceFactory class.
public Log4NetServiceFactory ( string configFile ) : System
configFile string The path to a log4net configuration file (or empty to use app.config).
return System

Shutdown() public method

Closes all the resources held by the various loggers.
public Shutdown ( ) : void
return void