log4net With SharePoint Layout Page Applications

Using log4net with SharePoint layout page applications is really no different from using it with other types of web applications with the exception that there really isn’t a convenient way to initialize the logging configuration from your custom binaries.

The answer lies in the oft overlooked AssemblyInfo.cs file.

Add the following line to the file:

[assembly: log4net.Config.XmlConfigurator(Watch = true)]

You may also want to add log4net binary to the /App_Bin directory of the WSS virtual directory GAC (as well as the configuration into the web.config file of the application, of course).

You may also like...

1 Response

  1. October 10, 2010

    […] SharePoint with log4net […]