ILogExtensions Class | Apache log4net™ SDK Documentation

The static class ILogExtensions contains a set of widely used methods that ease the interaction with the ILog interface implementations.
Inheritance Hierarchy

System
Object
log4net.Util
ILogExtensions

Namespace: log4net.Util
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public static class ILogExtensions

    <ExtensionAttribute>
    Public NotInheritable Class ILogExtensions

    [ExtensionAttribute]
    public ref class ILogExtensions abstract sealed

    [<AbstractClassAttribute>]
    [<SealedAttribute>]
    [<ExtensionAttribute>]
    type ILogExtensions =  class end

Methods

| Name | Description
--- | --- | ---
| DebugExt(ILog, Func TResult ) |
| DebugExt(ILog, Object) | Log a message object with the Debug level.
| DebugExt(ILog, Func TResult , Void) |
| DebugExt(ILog, Object, Exception) | Log a message object with the Debug level including the stack trace of the Exception passed as a parameter.
| DebugFormatExt(ILog, String, Object) | Logs a formatted message string with the Debug level.
| DebugFormatExt(ILog, String, Object ) | Logs a formatted message string with the Debug level.
| DebugFormatExt(ILog, IFormatProvider, String, Object ) | Logs a formatted message string with the Debug level.
| DebugFormatExt(ILog, String, Object, Object) | Logs a formatted message string with the Debug level.
| DebugFormatExt(ILog, String, Object, Object, Object) | Logs a formatted message string with the Debug level.
| ErrorExt(ILog, Func TResult ) |
| ErrorExt(ILog, Object) | Log a message object with the Error level.
| ErrorExt(ILog, Func TResult , Void) |
| ErrorExt(ILog, Object, Exception) | Log a message object with the Error level including the stack trace of the Exception passed as a parameter.
| ErrorFormatExt(ILog, String, Object) | Logs a formatted message string with the Error level.
| ErrorFormatExt(ILog, String, Object ) | Logs a formatted message string with the Error level.
| ErrorFormatExt(ILog, IFormatProvider, String, Object ) | Logs a formatted message string with the Error level.
| ErrorFormatExt(ILog, String, Object, Object) | Logs a formatted message string with the Error level.
| ErrorFormatExt(ILog, String, Object, Object, Object) | Logs a formatted message string with the Error level.
| FatalExt(ILog, Func TResult ) |
| FatalExt(ILog, Object) | Log a message object with the Fatal level.
| FatalExt(ILog, Func TResult , Void) |
| FatalExt(ILog, Object, Exception) | Log a message object with the Fatal level including the stack trace of the Exception passed as a parameter.
| FatalFormatExt(ILog, String, Object) | Logs a formatted message string with the Fatal level.
| FatalFormatExt(ILog, String, Object ) | Logs a formatted message string with the Fatal level.
| FatalFormatExt(ILog, IFormatProvider, String, Object ) | Logs a formatted message string with the Fatal level.
| FatalFormatExt(ILog, String, Object, Object) | Logs a formatted message string with the Fatal level.
| FatalFormatExt(ILog, String, Object, Object, Object) | Logs a formatted message string with the Fatal level.
| InfoExt(ILog, Func TResult ) |
| InfoExt(ILog, Object) | Log a message object with the Info level.
| InfoExt(ILog, Func TResult , Void) |
| InfoExt(ILog, Object, Exception) | Log a message object with the Info level including the stack trace of the Exception passed as a parameter.
| InfoFormatExt(ILog, String, Object) | Logs a formatted message string with the Info level.
| InfoFormatExt(ILog, String, Object ) | Logs a formatted message string with the Info level.
| InfoFormatExt(ILog, IFormatProvider, String, Object ) | Logs a formatted message string with the Info level.
| InfoFormatExt(ILog, String, Object, Object) | Logs a formatted message string with the Info level.
| InfoFormatExt(ILog, String, Object, Object, Object) | Logs a formatted message string with the Info level.
| WarnExt(ILog, Func TResult ) |
| WarnExt(ILog, Object) | Log a message object with the Warn level.
| WarnExt(ILog, Func TResult , Void) |
| WarnExt(ILog, Object, Exception) | Log a message object with the Warn level including the stack trace of the Exception passed as a parameter.
| WarnFormatExt(ILog, String, Object) | Logs a formatted message string with the Warn level.
| WarnFormatExt(ILog, String, Object ) | Logs a formatted message string with the Warn level.
| WarnFormatExt(ILog, IFormatProvider, String, Object ) | Logs a formatted message string with the Warn level.
| WarnFormatExt(ILog, String, Object, Object) | Logs a formatted message string with the Warn level.
| WarnFormatExt(ILog, String, Object, Object, Object) | Logs a formatted message string with the Warn level.

Top
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.

Examples

Simple example of logging messages
C#
Copy

    using log4net.Util;

    ILog log = LogManager.GetLogger("application-log");

    log.InfoExt("Application Start");
    log.DebugExt("This is a debug message");

See Also

#### Reference

log4net.Util Namespace