Class ILogExtensions
The static class ILogExtensions contains a set of widely used methods that ease the interaction with the ILog interface implementations.
public static class ILogExtensions
- Inheritance
-
ILogExtensions
- Inherited Members
Examples
Simple example of logging messages
<pre><code class="lang-csharp">using log4net.Util;
ILog log = LogManager.GetLogger("application-log");
log.InfoExt("Application Start"); log.DebugExt("This is a debug message");
Remarks
This class contains methods for logging at different levels and checks the properties for determining if those logging levels are enabled in the current configuration.
Methods
DebugExt(ILog, Func<object>)
Log a message object with the Debug level.
public static void DebugExt(this ILog logger, Func<object> callback)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
Remarks
This method first checks if this logger is INFO
enabled by reading the value IsDebugEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is INFO enabled, then it converts
the message object (retrieved by invocation of the provided callback) to a
string by invoking the appropriate IObjectRenderer.
It then proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the DebugExt(ILog, Func<object>, Exception) form instead.
- See Also
DebugExt(ILog, Func<object>, Exception)
Log a message object with the Debug level including the stack trace of the Exception passed as a parameter.
public static void DebugExt(this ILog logger, Func<object> callback, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the DebugExt(ILog, object) form for more detailed information.
- See Also
DebugExt(ILog, object)
Log a message object with the Debug level.
public static void DebugExt(this ILog logger, object message)
Parameters
Remarks
This method first checks if this logger is INFO
enabled by reading the value IsDebugEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is INFO enabled, then it converts
the message object (passed as parameter) to a string by invoking the appropriate
IObjectRenderer. It then
proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the DebugExt(ILog, object, Exception) form instead.
- See Also
DebugExt(ILog, object, Exception)
Log a message object with the Debug level including the stack trace of the Exception passed as a parameter.
public static void DebugExt(this ILog logger, object message, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
messageobjectThe message object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the DebugExt(ILog, object) form for more detailed information.
- See Also
DebugFormatExt(ILog, IFormatProvider, string, params object[])
Logs a formatted message string with the Debug level.
public static void DebugFormatExt(this ILog logger, IFormatProvider provider, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
providerIFormatProviderAn IFormatProvider that supplies culture-specific formatting information
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the DebugExt(ILog, object, Exception) methods instead.
- See Also
DebugFormatExt(ILog, string, object)
Logs a formatted message string with the Debug level.
public static void DebugFormatExt(this ILog logger, string format, object arg0)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the DebugExt(ILog, object, Exception) methods instead.
- See Also
DebugFormatExt(ILog, string, object, object)
Logs a formatted message string with the Debug level.
public static void DebugFormatExt(this ILog logger, string format, object arg0, object arg1)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the DebugExt(ILog, object, Exception) methods instead.
- See Also
DebugFormatExt(ILog, string, object, object, object)
Logs a formatted message string with the Debug level.
public static void DebugFormatExt(this ILog logger, string format, object arg0, object arg1, object arg2)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
arg2objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the DebugExt(ILog, object, Exception) methods instead.
- See Also
DebugFormatExt(ILog, string, params object[])
Logs a formatted message string with the Debug level.
public static void DebugFormatExt(this ILog logger, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the DebugExt(ILog, object, Exception) methods instead.
- See Also
ErrorExt(ILog, Func<object>)
Log a message object with the Error level.
public static void ErrorExt(this ILog logger, Func<object> callback)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
Remarks
This method first checks if this logger is ERROR
enabled by reading the value IsErrorEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is ERROR enabled, then it converts
the message object (retrieved by invocation of the provided callback) to a
string by invoking the appropriate IObjectRenderer.
It then proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the ErrorExt(ILog, Func<object>, Exception) form instead.
- See Also
ErrorExt(ILog, Func<object>, Exception)
Log a message object with the Error level including the stack trace of the Exception passed as a parameter.
public static void ErrorExt(this ILog logger, Func<object> callback, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the ErrorExt(ILog, object) form for more detailed information.
- See Also
ErrorExt(ILog, object)
Log a message object with the Error level.
public static void ErrorExt(this ILog logger, object message)
Parameters
Remarks
This method first checks if this logger is ERROR
enabled by reading the value IsErrorEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is ERROR enabled, then it converts
the message object (passed as parameter) to a string by invoking the appropriate
IObjectRenderer. It then
proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the ErrorExt(ILog, object, Exception) form instead.
- See Also
ErrorExt(ILog, object, Exception)
Log a message object with the Error level including the stack trace of the Exception passed as a parameter.
public static void ErrorExt(this ILog logger, object message, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
messageobjectThe message object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the ErrorExt(ILog, object) form for more detailed information.
- See Also
ErrorFormatExt(ILog, IFormatProvider, string, params object[])
Logs a formatted message string with the Error level.
public static void ErrorFormatExt(this ILog logger, IFormatProvider provider, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
providerIFormatProviderAn IFormatProvider that supplies culture-specific formatting information
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the ErrorExt(ILog, object, Exception) methods instead.
- See Also
ErrorFormatExt(ILog, string, object)
Logs a formatted message string with the Error level.
public static void ErrorFormatExt(this ILog logger, string format, object arg0)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the ErrorExt(ILog, object, Exception) methods instead.
- See Also
ErrorFormatExt(ILog, string, object, object)
Logs a formatted message string with the Error level.
public static void ErrorFormatExt(this ILog logger, string format, object arg0, object arg1)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the ErrorExt(ILog, object, Exception) methods instead.
- See Also
ErrorFormatExt(ILog, string, object, object, object)
Logs a formatted message string with the Error level.
public static void ErrorFormatExt(this ILog logger, string format, object arg0, object arg1, object arg2)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
arg2objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the ErrorExt(ILog, object, Exception) methods instead.
- See Also
ErrorFormatExt(ILog, string, params object[])
Logs a formatted message string with the Error level.
public static void ErrorFormatExt(this ILog logger, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the ErrorExt(ILog, object, Exception) methods instead.
- See Also
FatalExt(ILog, Func<object>)
Log a message object with the Fatal level.
public static void FatalExt(this ILog logger, Func<object> callback)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
Remarks
This method first checks if this logger is FATAL
enabled by reading the value IsFatalEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is FATAL enabled, then it converts
the message object (retrieved by invocation of the provided callback) to a
string by invoking the appropriate IObjectRenderer.
It then proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the FatalExt(ILog, Func<object>, Exception) form instead.
- See Also
FatalExt(ILog, Func<object>, Exception)
Log a message object with the Fatal level including the stack trace of the Exception passed as a parameter.
public static void FatalExt(this ILog logger, Func<object> callback, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the FatalExt(ILog, object) form for more detailed information.
- See Also
FatalExt(ILog, object)
Log a message object with the Fatal level.
public static void FatalExt(this ILog logger, object message)
Parameters
Remarks
This method first checks if this logger is FATAL
enabled by reading the value IsFatalEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is FATAL enabled, then it converts
the message object (passed as parameter) to a string by invoking the appropriate
IObjectRenderer. It then
proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the FatalExt(ILog, object, Exception) form instead.
- See Also
FatalExt(ILog, object, Exception)
Log a message object with the Fatal level including the stack trace of the Exception passed as a parameter.
public static void FatalExt(this ILog logger, object message, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
messageobjectThe message object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the FatalExt(ILog, object) form for more detailed information.
- See Also
FatalFormatExt(ILog, IFormatProvider, string, params object[])
Logs a formatted message string with the Fatal level.
public static void FatalFormatExt(this ILog logger, IFormatProvider provider, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
providerIFormatProviderAn IFormatProvider that supplies culture-specific formatting information
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the FatalExt(ILog, object, Exception) methods instead.
- See Also
FatalFormatExt(ILog, string, object)
Logs a formatted message string with the Fatal level.
public static void FatalFormatExt(this ILog logger, string format, object arg0)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the FatalExt(ILog, object, Exception) methods instead.
- See Also
FatalFormatExt(ILog, string, object, object)
Logs a formatted message string with the Fatal level.
public static void FatalFormatExt(this ILog logger, string format, object arg0, object arg1)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the FatalExt(ILog, object, Exception) methods instead.
- See Also
FatalFormatExt(ILog, string, object, object, object)
Logs a formatted message string with the Fatal level.
public static void FatalFormatExt(this ILog logger, string format, object arg0, object arg1, object arg2)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
arg2objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the FatalExt(ILog, object, Exception) methods instead.
- See Also
FatalFormatExt(ILog, string, params object[])
Logs a formatted message string with the Fatal level.
public static void FatalFormatExt(this ILog logger, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the FatalExt(ILog, object, Exception) methods instead.
- See Also
InfoExt(ILog, Func<object>)
Log a message object with the Info level.
public static void InfoExt(this ILog logger, Func<object> callback)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
Remarks
This method first checks if this logger is INFO
enabled by reading the value IsInfoEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is INFO enabled, then it converts
the message object (retrieved by invocation of the provided callback) to a
string by invoking the appropriate IObjectRenderer.
It then proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the InfoExt(ILog, Func<object>, Exception) form instead.
- See Also
InfoExt(ILog, Func<object>, Exception)
Log a message object with the Info level including the stack trace of the Exception passed as a parameter.
public static void InfoExt(this ILog logger, Func<object> callback, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the InfoExt(ILog, object) form for more detailed information.
- See Also
InfoExt(ILog, object)
Log a message object with the Info level.
public static void InfoExt(this ILog logger, object message)
Parameters
Remarks
This method first checks if this logger is INFO
enabled by reading the value IsInfoEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is INFO enabled, then it converts
the message object (passed as parameter) to a string by invoking the appropriate
IObjectRenderer. It then
proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the InfoExt(ILog, object, Exception) form instead.
- See Also
InfoExt(ILog, object, Exception)
Log a message object with the Info level including the stack trace of the Exception passed as a parameter.
public static void InfoExt(this ILog logger, object message, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
messageobjectThe message object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the InfoExt(ILog, object) form for more detailed information.
- See Also
InfoFormatExt(ILog, IFormatProvider, string, params object[])
Logs a formatted message string with the Info level.
public static void InfoFormatExt(this ILog logger, IFormatProvider provider, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
providerIFormatProviderAn IFormatProvider that supplies culture-specific formatting information
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the InfoExt(ILog, object, Exception) methods instead.
- See Also
InfoFormatExt(ILog, string, object)
Logs a formatted message string with the Info level.
public static void InfoFormatExt(this ILog logger, string format, object arg0)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the InfoExt(ILog, object, Exception) methods instead.
- See Also
InfoFormatExt(ILog, string, object, object)
Logs a formatted message string with the Info level.
public static void InfoFormatExt(this ILog logger, string format, object arg0, object arg1)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the InfoExt(ILog, object, Exception) methods instead.
- See Also
InfoFormatExt(ILog, string, object, object, object)
Logs a formatted message string with the Info level.
public static void InfoFormatExt(this ILog logger, string format, object arg0, object arg1, object arg2)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
arg2objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the InfoExt(ILog, object, Exception) methods instead.
- See Also
InfoFormatExt(ILog, string, params object[])
Logs a formatted message string with the Info level.
public static void InfoFormatExt(this ILog logger, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the InfoExt(ILog, object, Exception) methods instead.
- See Also
WarnExt(ILog, Func<object>)
Log a message object with the Warn level.
public static void WarnExt(this ILog logger, Func<object> callback)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
Remarks
This method first checks if this logger is WARN
enabled by reading the value IsWarnEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is WARN enabled, then it converts
the message object (retrieved by invocation of the provided callback) to a
string by invoking the appropriate IObjectRenderer.
It then proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the WarnExt(ILog, Func<object>, Exception) form instead.
- See Also
WarnExt(ILog, Func<object>, Exception)
Log a message object with the Warn level including the stack trace of the Exception passed as a parameter.
public static void WarnExt(this ILog logger, Func<object> callback, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
callbackFunc<object>The lambda expression that gets the object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the WarnExt(ILog, object) form for more detailed information.
- See Also
WarnExt(ILog, object)
Log a message object with the Warn level.
public static void WarnExt(this ILog logger, object message)
Parameters
Remarks
This method first checks if this logger is WARN
enabled by reading the value IsWarnEnabled property.
This check happens always and does not depend on the ILog
implementation. If this logger is WARN enabled, then it converts
the message object (passed as parameter) to a string by invoking the appropriate
IObjectRenderer. It then
proceeds to call all the registered appenders in this logger
and also higher in the hierarchy depending on the value of
the additivity flag.
WARNING Note that passing an Exception to this method will print the name of the Exception but no stack trace. To print a stack trace use the WarnExt(ILog, object, Exception) form instead.
- See Also
WarnExt(ILog, object, Exception)
Log a message object with the Warn level including the stack trace of the Exception passed as a parameter.
public static void WarnExt(this ILog logger, object message, Exception exception)
Parameters
loggerILogThe logger on which the message is logged.
messageobjectThe message object to log.
exceptionExceptionThe exception to log, including its stack trace.
Remarks
See the WarnExt(ILog, object) form for more detailed information.
- See Also
WarnFormatExt(ILog, IFormatProvider, string, params object[])
Logs a formatted message string with the Warn level.
public static void WarnFormatExt(this ILog logger, IFormatProvider provider, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
providerIFormatProviderAn IFormatProvider that supplies culture-specific formatting information
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the WarnExt(ILog, object, Exception) methods instead.
- See Also
WarnFormatExt(ILog, string, object)
Logs a formatted message string with the Warn level.
public static void WarnFormatExt(this ILog logger, string format, object arg0)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the WarnExt(ILog, object, Exception) methods instead.
- See Also
WarnFormatExt(ILog, string, object, object)
Logs a formatted message string with the Warn level.
public static void WarnFormatExt(this ILog logger, string format, object arg0, object arg1)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the WarnExt(ILog, object, Exception) methods instead.
- See Also
WarnFormatExt(ILog, string, object, object, object)
Logs a formatted message string with the Warn level.
public static void WarnFormatExt(this ILog logger, string format, object arg0, object arg1, object arg2)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
arg0objectAn Object to format
arg1objectAn Object to format
arg2objectAn Object to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the WarnExt(ILog, object, Exception) methods instead.
- See Also
WarnFormatExt(ILog, string, params object[])
Logs a formatted message string with the Warn level.
public static void WarnFormatExt(this ILog logger, string format, params object[] args)
Parameters
loggerILogThe logger on which the message is logged.
formatstringA String containing zero or more format items
argsobject[]An Object array containing zero or more objects to format
Remarks
The message is formatted using the String.Format method. See
Format(string, params object[]) for details of the syntax of the format string and the behavior
of the formatting.
This method does not take an Exception object to include in the log event. To pass an Exception use one of the WarnExt(ILog, object, Exception) methods instead.
- See Also