Common Logging 2.0 API Reference

Common.Logging Assembly

This assembly contains the core functionality of the Common.Logging framework. In particular, checkout LogManager and ILog for usage information.

Referenced Assemblies

Assembly Reference Description
mscorlib  
System  
System.Configuration  
System.Xml  

Dependent Assemblies

Assembly Description
Common.Logging.EntLib

This assembly contains the adapter to plug Microsoft Enterprise Logging Library 3.1. into the Common.Logging infrastructure.

For an example on how to configure

Common.Logging.EntLib41

This assembly contains the adapter to plug Microsoft Enterprise Logging Library 4.1. into the Common.Logging infrastructure.

For an example on how to configure

Common.Logging.Log4Net

This assembly contains the adapter to the log4net 1.2.10 library

For an example on how to configure

Common.Logging.Log4Net129

This assembly contains the adapter to the log4net 1.2.9 library

For an example on how to configure

Common.Logging.NLog

This assembly contains the implementations to plug NLog 1.0.0.505 into Common.Logging.

For an example on how to configure

Namespaces

Namespace Description
Common.Logging This namespace contains all core classes making up the Common.Logging framework.
Common.Logging.Configuration This namespace contains various utility classes.
Common.Logging.Factory This namespace contains convenience base classes for implementing your own ILoggerFactoryAdapters.
Common.Logging.Simple This namespace contains out-of-the-box adapters to intrinsic systems, namely ConsoleOutLoggerFactoryAdapter and TraceLoggerFactoryAdapter.

Classes

Class Description
AbstractCachingLoggerFactoryAdapter An implementation of ILoggerFactoryAdapter that caches loggers handed out by this factory.
AbstractLogger Provides base implementation common for most logger adapters
AbstractSimpleLogger Abstract class providing a standard implementation of simple loggers.
AbstractSimpleLoggerFactoryAdapter Base factory implementation for creating simple ILog instances.
ArgUtils Various utility methods for using during factory and logger instance configuration
CapturingLogger A logger created by CapturingLoggerFactoryAdapter that sends all log events to the owning adapter's AddEvent
CapturingLoggerEvent A logging event captured by CapturingLogger
CapturingLoggerFactoryAdapter An adapter, who's loggers capture all log events and send them to AddEvent. Retrieve the list of log events from LoggerEvents.
CommonLoggingTraceListener A TraceListener implementation sending all System.Diagnostics.Trace output to the Common.Logging infrastructure.
ConfigurationException The exception that is thrown when a configuration system error has occurred with Common.Logging
ConfigurationSectionHandler Used in an application's configuration file (App.Config or Web.Config) to configure the logging subsystem.
ConsoleOutLogger Sends log messages to Out.
ConsoleOutLoggerFactoryAdapter Factory for creating ILog instances that write data to Out.
DefaultConfigurationReader Implementation of IConfigurationReader that uses the standard .NET configuration APIs, ConfigurationSettings in 1.x and ConfigurationManager in 2.0
LogManager Use the LogManager's GetLogger or GetLogger methods to obtain ILog instances for logging.
LogSetting Container used to hold configuration information from config file.
NoOpLogger Silently ignores all log messages.
NoOpLoggerFactoryAdapter Factory for creating ILog instances that silently ignores logging requests.
TraceLogger Logger sending everything to the trace output stream using Trace.
TraceLoggerFactoryAdapter Factory for creating ILog instances that send everything to the Trace output stream.

Interfaces

Interface Description
IConfigurationReader Interface for basic operations to read .NET application configuration information.
ILog A simple logging interface abstracting logging APIs.
ILoggerFactoryAdapter LoggerFactoryAdapter interface is used internally by LogManager Only developers wishing to write new Common.Logging adapters need to worry about this interface.

Delegates

Delegate Description
AbstractLogger.WriteHandler Represents a method responsible for writing a message to the log system.
ArgUtils.Action An anonymous action delegate with no arguments and no return value.
ArgUtils.Function(T) An anonymous action delegate with no arguments and no return value.
ArgUtils.ParseHandler(T) A delegate converting a string representation into the target type
FormatMessageHandler The type of method that is passed into e.g. Debug and allows the callback method to "submit" it's message to the underlying output system.

Enumerations

Enumeration Description
LogLevel The 7 possible logging levels