Building Apache log4net™

The log4net release builds are built using NAnt. Log4net can also be built using Visual Studio .NET 2008 or 2010.

Visual Studio

Visual Studio .NET 2008 and 2010 are supported build platforms for log4net.

Visual Studio .NET 2008

The log4net distribution includes a solution and project file for Visual Studio .NET 2008. Open the log4net.vs2008.sln from the src directory in the distribution.

The log4net project requires only the following references:

  • System
  • System.Configuration
  • System.Data
  • System.Web
  • System.XML

Visual Studio .NET 2010

The log4net distribution includes a solution and project file for Visual Studio .NET 2010. Open the log4net.vs2010.sln from the src directory in the distribution.

The log4net project requires only the following references:

  • System
  • System.Configuration
  • System.Data
  • System.Web
  • System.XML

NAnt

The log4net distribution is built using the NAnt tool. A recent NAnt version 0.91 alpha2 is required to build log4net, this is available from nant.sourceforge.net.

To support building log4net for the SSCLI framework the NAnt configuration files need to be updated to specify the SSCLI framework directory.

To build log4net from the command line, change directory to the root of the log4net distribution, ensure that the nant executable is in the PATH, and then run the following command:

nant -buildfile:log4net.build compile-all

This command will build log4net for all the supported frameworks that are available on the current machine. To list all the build targets that are available run the following command:

nant -buildfile:log4net.build -projecthelp

Under windows the build.cmd can be used to script the nant build. This can be called from a different directory and will locate the correct log4net.build file to use. For example:

build.cmd compile-all

SDK Reference

NDoc 1.3 is used to build the log4net SDK documentation using the generate-sdkdoc target in log4net's Nant build file. NDoc is available from ndoc.sourceforge.net.

HTML Documentation

The log4net HTML documentation is built using Apache Maven. The source are files in various formats in the src/site directory. Building the documentation requires Java 5 or newer and Maven 2.2.1 or newer. Run mvn from within the root directory.

SDK documentation for the site is built using the generate-sdkdoc-for-site target in log4net's NAnt build file.

It is not recommended to use mvn's site:deploy goal but rather to deploy the site generated to target/site manually.