Activation error occured while trying to get instance of type LogWriter, key ""?

Topics: Logging Application Block
Oct 18, 2011 at 9:57 PM
Edited Oct 18, 2011 at 10:00 PM
I have asp.net web site. I added reference of  `Microsoft.Practices.EnterpriseLibrary.Logging.dll` to the site. 

in web.cofig file, I defined like below.
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />   
  <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
  defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging"
       listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging"
       fileName=".\exception.log" 
       formatter="Text Formatter" 
       rollFileExistsBehavior="Increment" rollInterval="Midnight" rollSizeKB="20"
       timeStampPattern="yyyy-MM-dd" maxArchivedFiles="3" traceOutputOptions="None"
       filter="All"  />  
    </listeners>
When I run the code exception happening below place.

defaultWriter = EnterpriseLibraryContainer.Current.GetInstance<LogWriter>();
 //errr: Activation error occured while trying to get instance of type LogWriter, key ""


How to resolve this?