C# Class Common.Logging.Factory.AbstractLogger

Inheritance: ILog
Mostra file Open project: net-commons/common-logging Class Usage Examples

Public Methods

Method Description
Debug ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Debug level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Debug ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Debug level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Debug ( System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Debug level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Debug ( System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Debug level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Debug ( object message ) : void

Log a message object with the LogLevel.Debug level.

Debug ( object message, Exception exception ) : void

Log a message object with the LogLevel.Debug level including the stack Debug of the Exception passed as a parameter.

Error ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Error level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Error ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Error level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Error ( System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Error level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Error ( System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Error level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Error ( object message ) : void

Log a message object with the LogLevel.Error level.

Error ( object message, Exception exception ) : void

Log a message object with the LogLevel.Error level including the stack Error of the Exception passed as a parameter.

Fatal ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Fatal level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Fatal ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Fatal level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Fatal ( System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Fatal level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Fatal ( System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Fatal level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Fatal ( object message ) : void

Log a message object with the LogLevel.Fatal level.

Fatal ( object message, Exception exception ) : void

Log a message object with the LogLevel.Fatal level including the stack Fatal of the Exception passed as a parameter.

Info ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Info level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Info ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Info level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Info ( System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Info level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Info ( System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Info level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Info ( object message ) : void

Log a message object with the LogLevel.Info level.

Info ( object message, Exception exception ) : void

Log a message object with the LogLevel.Info level including the stack Info of the Exception passed as a parameter.

Trace ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Trace level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Trace ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Trace level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Trace ( System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Trace level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Trace ( System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Trace level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Trace ( object message ) : void

Log a message object with the LogLevel.Trace level.

Trace ( object message, Exception exception ) : void

Log a message object with the LogLevel.Trace level including the stack trace of the Exception passed as a parameter.

Warn ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Warn level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Warn ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Warn level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Warn ( System.Action formatMessageCallback ) : void

Log a message with the LogLevel.Warn level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Warn ( System.Action formatMessageCallback, Exception exception ) : void

Log a message with the LogLevel.Warn level using a callback to obtain the message

Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.

Warn ( object message ) : void

Log a message object with the LogLevel.Warn level.

Warn ( object message, Exception exception ) : void

Log a message object with the LogLevel.Warn level including the stack Warn of the Exception passed as a parameter.

Protected Methods

Method Description
AbstractLogger ( ) : System

Creates a new logger instance using WriteInternal for writing log events to the underlying log system.

GetWriteHandler ( ) : WriteHandler

Override this method to use a different method than WriteInternal for writing log events to the underlying log system.

Usually you don't need to override thise method. The default implementation returns null to indicate that the default handler WriteInternal should be used.

WriteInternal ( LogLevel level, object message, Exception exception ) : void

Actually sends the message to the underlying log system.

Private Methods

Method Description
DebugFormat ( IFormatProvider formatProvider, string format ) : void
DebugFormat ( IFormatProvider formatProvider, string format, Exception exception ) : void
DebugFormat ( string format ) : void
DebugFormat ( string format, Exception exception ) : void
ErrorFormat ( IFormatProvider formatProvider, string format ) : void
ErrorFormat ( IFormatProvider formatProvider, string format, Exception exception ) : void
ErrorFormat ( string format ) : void
ErrorFormat ( string format, Exception exception ) : void
FatalFormat ( IFormatProvider formatProvider, string format ) : void
FatalFormat ( IFormatProvider formatProvider, string format, Exception exception ) : void
FatalFormat ( string format ) : void
FatalFormat ( string format, Exception exception ) : void
InfoFormat ( IFormatProvider formatProvider, string format ) : void
InfoFormat ( IFormatProvider formatProvider, string format, Exception exception ) : void
InfoFormat ( string format ) : void
InfoFormat ( string format, Exception exception ) : void
TraceFormat ( IFormatProvider formatProvider, string format ) : void
TraceFormat ( IFormatProvider formatProvider, string format, Exception exception ) : void
TraceFormat ( string format ) : void
TraceFormat ( string format, Exception exception ) : void
WarnFormat ( IFormatProvider formatProvider, string format ) : void
WarnFormat ( IFormatProvider formatProvider, string format, Exception exception ) : void
WarnFormat ( string format ) : void
WarnFormat ( string format, Exception exception ) : void

Method Details

AbstractLogger() protected method

Creates a new logger instance using WriteInternal for writing log events to the underlying log system.
protected AbstractLogger ( ) : System
return System

Debug() public method

Log a message with the LogLevel.Debug level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Debug ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Debug() public method

Log a message with the LogLevel.Debug level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Debug ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Debug.
return void

Debug() public method

Log a message with the LogLevel.Debug level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Debug ( System.Action formatMessageCallback ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Debug() public method

Log a message with the LogLevel.Debug level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Debug ( System.Action formatMessageCallback, Exception exception ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Debug.
return void

Debug() public method

Log a message object with the LogLevel.Debug level.
public Debug ( object message ) : void
message object The message object to log.
return void

Debug() public method

Log a message object with the LogLevel.Debug level including the stack Debug of the Exception passed as a parameter.
public Debug ( object message, Exception exception ) : void
message object The message object to log.
exception System.Exception The exception to log, including its stack Debug.
return void

Error() public method

Log a message with the LogLevel.Error level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Error ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Error() public method

Log a message with the LogLevel.Error level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Error ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Error.
return void

Error() public method

Log a message with the LogLevel.Error level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Error ( System.Action formatMessageCallback ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Error() public method

Log a message with the LogLevel.Error level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Error ( System.Action formatMessageCallback, Exception exception ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Error.
return void

Error() public method

Log a message object with the LogLevel.Error level.
public Error ( object message ) : void
message object The message object to log.
return void

Error() public method

Log a message object with the LogLevel.Error level including the stack Error of the Exception passed as a parameter.
public Error ( object message, Exception exception ) : void
message object The message object to log.
exception System.Exception The exception to log, including its stack Error.
return void

Fatal() public method

Log a message with the LogLevel.Fatal level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Fatal ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Fatal() public method

Log a message with the LogLevel.Fatal level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Fatal ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Fatal.
return void

Fatal() public method

Log a message with the LogLevel.Fatal level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Fatal ( System.Action formatMessageCallback ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Fatal() public method

Log a message with the LogLevel.Fatal level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Fatal ( System.Action formatMessageCallback, Exception exception ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Fatal.
return void

Fatal() public method

Log a message object with the LogLevel.Fatal level.
public Fatal ( object message ) : void
message object The message object to log.
return void

Fatal() public method

Log a message object with the LogLevel.Fatal level including the stack Fatal of the Exception passed as a parameter.
public Fatal ( object message, Exception exception ) : void
message object The message object to log.
exception System.Exception The exception to log, including its stack Fatal.
return void

GetWriteHandler() protected method

Override this method to use a different method than WriteInternal for writing log events to the underlying log system.
Usually you don't need to override thise method. The default implementation returns null to indicate that the default handler WriteInternal should be used.
protected GetWriteHandler ( ) : WriteHandler
return WriteHandler

Info() public method

Log a message with the LogLevel.Info level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Info ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Info() public method

Log a message with the LogLevel.Info level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Info ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Info.
return void

Info() public method

Log a message with the LogLevel.Info level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Info ( System.Action formatMessageCallback ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Info() public method

Log a message with the LogLevel.Info level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Info ( System.Action formatMessageCallback, Exception exception ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Info.
return void

Info() public method

Log a message object with the LogLevel.Info level.
public Info ( object message ) : void
message object The message object to log.
return void

Info() public method

Log a message object with the LogLevel.Info level including the stack Info of the Exception passed as a parameter.
public Info ( object message, Exception exception ) : void
message object The message object to log.
exception System.Exception The exception to log, including its stack Info.
return void

Trace() public method

Log a message with the LogLevel.Trace level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Trace ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Trace() public method

Log a message with the LogLevel.Trace level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Trace ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack trace.
return void

Trace() public method

Log a message with the LogLevel.Trace level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Trace ( System.Action formatMessageCallback ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Trace() public method

Log a message with the LogLevel.Trace level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Trace ( System.Action formatMessageCallback, Exception exception ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack trace.
return void

Trace() public method

Log a message object with the LogLevel.Trace level.
public Trace ( object message ) : void
message object The message object to log.
return void

Trace() public method

Log a message object with the LogLevel.Trace level including the stack trace of the Exception passed as a parameter.
public Trace ( object message, Exception exception ) : void
message object The message object to log.
exception System.Exception The exception to log, including its stack trace.
return void

Warn() public method

Log a message with the LogLevel.Warn level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Warn ( IFormatProvider formatProvider, System.Action formatMessageCallback ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Warn() public method

Log a message with the LogLevel.Warn level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Warn ( IFormatProvider formatProvider, System.Action formatMessageCallback, Exception exception ) : void
formatProvider IFormatProvider An that supplies culture-specific formatting information.
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Warn.
return void

Warn() public method

Log a message with the LogLevel.Warn level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Warn ( System.Action formatMessageCallback ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
return void

Warn() public method

Log a message with the LogLevel.Warn level using a callback to obtain the message
Using this method avoids the cost of creating a message and evaluating message arguments that probably won't be logged due to loglevel settings.
public Warn ( System.Action formatMessageCallback, Exception exception ) : void
formatMessageCallback System.Action A callback used by the logger to obtain the message if log level is matched
exception System.Exception The exception to log, including its stack Warn.
return void

Warn() public method

Log a message object with the LogLevel.Warn level.
public Warn ( object message ) : void
message object The message object to log.
return void

Warn() public method

Log a message object with the LogLevel.Warn level including the stack Warn of the Exception passed as a parameter.
public Warn ( object message, Exception exception ) : void
message object The message object to log.
exception System.Exception The exception to log, including its stack Warn.
return void

WriteInternal() protected abstract method

Actually sends the message to the underlying log system.
protected abstract WriteInternal ( LogLevel level, object message, Exception exception ) : void
level LogLevel the level of this log event.
message object the message to log
exception System.Exception the exception to log (may be null)
return void