Apache log4net� SDK Documentation - Microsoft .NET Framework 4.0

ILog Interface

The ILog interface is use by application to log messages into the log4net framework.

For a list of all members of this type, see ILog Members.

[Visual�Basic]
Public�Interface�ILog
����Implements�ILoggerWrapper
[C#]
public�interface�ILog : ILoggerWrapper

Types that implement ILog

Type Description
LogImpl Implementation of ILog wrapper interface.

Remarks

Use the LogManager to obtain logger instances that implement this interface. The GetLogger static method is used to get logger instances.

This class contains methods for logging at different levels and also has properties for determining if those logging levels are enabled in the current configuration.

This interface can be implemented in different ways. This documentation specifies reasonable behavior that a caller can expect from the actual implementation, however different implementations reserve the right to do things differently.

Example

Simple example of logging messages

[C#]
ILog log = LogManager.GetLogger("application-log");

log.Info("Application Start");
log.Debug("This is a debug message");

if (log.IsDebugEnabled)
{
    log.Debug("This is another debug message");
}

Requirements

Namespace: log4net

Assembly: log4net (in log4net.dll)

See Also

ILog Members | log4net Namespace | LogManager | GetLogger