Random Thoughts of a Scatterbrain.
 Tuesday, May 13, 2008

log4net With SharePoint Layout Page Applications

5/13/2008 12:36:55 PM (Eastern Daylight Time, UTC-04:00)

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 (as well as the configuration into the web.config file of the application, of course).

Name
E-mail
Home page

Comment (HTML not allowed)  
Enter the code shown (prevents robots):

RSS 2.0 Atom 1.0 CDF