log4net is built on a number of different frameworks. Each new version of the frameworks add new features. To take advantage of these new features we must build log4net using the appropriate framework. We also maintain builds compatible with older versions of the frameworks.
It is important to remember that the .NET frameworks support backward compatibility, that is a new version of the framework will run binary assemblies that were targeted to previous versions of the framework.
While the number of different builds available may seem confusing, you only need to select the nearest build for your platform that is equal to or earlier than your chosen deployment framework. If you intend to deploy your application on the Microsoft .NET Framework 1.0 don't pick the log4net build that is built against the Microsoft .NET Framework 1.1 because the .NET framework does not guarantee forward compatibility only backward compatibility.
The lowest common denominator build is the CLI 1.0 Compatible build. This build is compatible with the ECMA/ISO CLI 1.0 standard APIs and will run on all frameworks that support the standard. (Note that the Microsoft .NET Compact Framework does not support this standard). Use this build if you intend to deploy you application on both the Microsoft .NET Frameworks and the Mono frameworks.
log4net now builds on 6 frameworks:
Framework | Website |
---|---|
Microsoft .NET Framework 1.0 (1.0.3705) | http://msdn.microsoft.com/net |
Microsoft .NET Framework 1.1 (1.1.4322) | http://msdn.microsoft.com/net |
Microsoft .NET Framework 2.0 (2.0.50727) | http://msdn.microsoft.com/net |
Microsoft .NET Compact Framework 1.0 | http://msdn2.microsoft.com/en-us/netframework/aa497273.aspx |
Mono 1.2.3 | http://www.mono-project.com |
Microsoft Shared Source CLI 1.0 | http://msdn.microsoft.com/library/en-us/dndotnet/html/mssharsourcecli.asp |
CLI 1.0 Compatible | http://msdn.microsoft.com/net/ecma/ |
For each of these frameworks a log4net assembly targeting the framework is supplied. Although it's perfectly possible to use the .NET Framework 1.0 version of log4net on the .NET Framework 1.1, having an assembly that really targets a specific framework allows us to use features in that framework that are not available in other frameworks or remove features from log4net that are not supported in a specific framework.
The appenders available to each framework depend on the functionality of the framework and the platform it runs on:
Appender | .NET Framework 1.0 | .NET Framework 1.1 | .NET Framework 2.0 | .NET CF 1.0 | Mono 1.2 | Shared Source CLI 1.0 | CLI 1.0 Compatible |
---|---|---|---|---|---|---|---|
AdoNetAppender | x | x | x | x | x | x | |
AnsiColorTerminalAppender | x | x | x | x | x | x | x |
AspNetTraceAppender | x | x | x | x | x | ||
BufferingForwardingAppender | x | x | x | x | x | x | x |
ColoredConsoleAppender | x | x | x | ||||
ConsoleAppender | x | x | x | x | x | x | x |
DebugAppender | x | x | x | x | x | x | x |
EventLogAppender | x | x | x | x | x | ||
FileAppender | x | x | x | x | x | x | x |
ForwardingAppender | x | x | x | x | x | x | x |
LocalSyslogAppender | x | x | x | x | x | ||
MemoryAppender | x | x | x | x | x | x | x |
NetSendAppender | x | x | x | ||||
OutputDebugStringAppender | x | x | x | x | |||
RemoteSyslogAppender | x | x | x | x | x | x | x |
RemotingAppender | x | x | x | x | x | x | |
RollingFileAppender | x | x | x | x | x | x | x |
SmtpAppender | x | x | x | x | x | ||
SmtpPickupDirAppender | x | x | x | x | x | x | x |
TelnetAppender | x | x | x | x | x | x | x |
TraceAppender | x | x | x | x | x | x | x |
UdpAppender | x | x | x | x | x | x | x |
none
none
none
For Smart-device applications, the log4net system can be configured by passing the location of the log4net configuration file to the log4net.Config.XmlConfigurator.Configure(FileInfo) method in the entry point of the application.
For example:
namespace TestApp { using System.IO; public class EntryPoint { /// <summary> /// Application entry point. /// </summary> public static void Main() { // Uncomment the next line to enable log4net internal debugging // log4net.Util.LogLog.InternalDebugging = true; // This will instruct log4net to look for a configuration file // called config.log4net in the root directory of the device log4net.Config.XmlConfigurator.Configure(new FileInfo(@"\config.log4net")); ... // This will shutdown the log4net system log4net.LogManager.Shutdown(); } } }
Applications will need to programmatically shutdown the log4net system during the application's shutdown using the log4net.LogManager.Shutdown() method in order to prevent losing logging events. See the code above for an example.
There are 2 separate builds of log4net for mono; Mono 1.0, built using the C# compiler in a mode which is compatible with the CLI 1.0 language specification, and; Mono 2.0, built using the .NET 2.0 extensions to the C# language.
none
none
This build of log4net is designed to run on any ECMA CLI 1.0 compatible runtime. The assembly does not support any platform specific features. The build includes the common subset of functionality found in the .NET 1.0 and Mono 1.0 builds. The output assembly is built using the Microsoft .NET 1.0 compiler and library.
The log4net CLI 1.0 assembly is runtime compatible with the following frameworks: