C# Class Itenso.Sys.Logging.Logger

Provides public access to logger implementations.
Exibir arquivo Open project: Shereef/RTF-to-HTML-Converter-Class-Library-DLL

Public Methods

Method Description
GetIgnoreAllLogger ( ) : ILogger

Always returns a logger that will ignore all output directed to it. This can be used to pass a logger instance to code which requires one while not actually desiring the resulting output.

GetLogger ( Type type ) : ILogger

Same as GetLogger( type.FullName ).

GetLogger ( string name ) : ILogger

Gets the logger with the specified name. Multiple calls with the same name will return the same instance.

InitializeLoggerFactory ( string factoryName ) : bool

Attempts to define which logger factory to use.

SetLogFile ( string absoluteLogFileName, bool append, string messagePattern ) : void

Sets a new file appender to the root logger.

This can be used if an application should log to a configurable file. currently only the log4net logging mechanism supports Use this feature by _not_ configuring a file appender in the app.config of the application and set an appender using this method. Like that logging will be effective only after this method has been called (except for other logger appenders of course).

Method Details

GetIgnoreAllLogger() public static method

Always returns a logger that will ignore all output directed to it. This can be used to pass a logger instance to code which requires one while not actually desiring the resulting output.
public static GetIgnoreAllLogger ( ) : ILogger
return ILogger

GetLogger() public static method

Same as GetLogger( type.FullName ).
public static GetLogger ( Type type ) : ILogger
type System.Type the type for which a logger should be retrieved
return ILogger

GetLogger() public static method

Gets the logger with the specified name. Multiple calls with the same name will return the same instance.
public static GetLogger ( string name ) : ILogger
name string the name of the logger to retrieve
return ILogger

InitializeLoggerFactory() public static method

Attempts to define which logger factory to use.
public static InitializeLoggerFactory ( string factoryName ) : bool
factoryName string the fully qualified class name of the logger factory
return bool

SetLogFile() public static method

Sets a new file appender to the root logger.
This can be used if an application should log to a configurable file. currently only the log4net logging mechanism supports Use this feature by _not_ configuring a file appender in the app.config of the application and set an appender using this method. Like that logging will be effective only after this method has been called (except for other logger appenders of course).
in case the active logger factory /// doesn't support this when given an empty or null log file name
public static SetLogFile ( string absoluteLogFileName, bool append, string messagePattern ) : void
absoluteLogFileName string the name of the log file
append bool whether to append or create new content
messagePattern string the message pattern; may be empty or null in which case /// a default pattern is used
return void