1: add the following line to the AssemblyInfo class
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
2: Make sure you are not using the .Net Framework 4 Client Profile as the Target Framework (I think this is fine on your side, because otherwise it wonโt even compile)
3: Make sure you log in very early. Otherwise, in some scenarios it will not be initialized properly (more about the log4net FAQ ).
So, register something during application launch in Global.asax
public class Global : System.Web.HttpApplication { private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(Global)); protected void Application_Start(object sender, EventArgs e) { Log.Info("Startup application.") } }
4: Make sure that you have permission to create files and folders on the specified path (if the folder itself also does not exist)
5: The rest of your information looks fine
hwcverwe Apr 18 '12 at 7:01 2012-04-18 07:01
source share