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.

public�interface�ILog : ILoggerWrapper

Types that implement ILog

Type Description
LogImpl Implementation of ILog wrapper interface.


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.


Simple example of logging messages

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");


Namespace: log4net

Assembly: log4net (in log4net.dll)

See Also

ILog Members | log4net Namespace | LogManager | GetLogger