This project is read-only.

log4net Configuration

Jan 5, 2010 at 11:35 PM

Hi Jon, James, Howard,

Another quick newb question:

In both the SA Northwind sample application and WCHM sample app, log4net is configured in the web.config.

In Northwind, we run the Configure() method on the log4net XmlConfigurator to init the settings, in global.asax:

    public class MvcApplication : HttpApplication
    {
        protected void Application_Start() {
            log4net.Config.XmlConfigurator.Configure();
            // ...
        }
    }

In WCHM, I don't see such a step in global.asax Application_Start(), nor anywhere else in the init or registration, as far as I can tell.

So the question is, how is log4net being configured? (if at all?) Or is it just disabled in the sample app?

I'm migrating from the EntLib logging application block to log4net, so please excuse any dumb questions.

Thank you in advance for your time, and many thanks again for the great app!

 

Jan 6, 2010 at 6:36 AM

Hi Martin,

log4net is not hooked up in the sample app yet - if you look around, you'll probably see a few TODOs in the code about adding logging. When we do get round to hooking it up, it will be configured in the same way as the Northwind sample app, amd we'll set it to log to the ~/Logs folder that ELMAH is writing it's logs to (obviously in a real production environment, it would log to the Windows Event Log or similar.)

Cheers, Jon