No log found in DB, ExceptionPolicy

Topics: Exception Handling Application Block, Logging Application Block
Jul 29, 2011 at 6:39 PM

Hi,

My requirement is - no log found in database tables. I changed database listener to Event Log Listener. I am able to see the error in Event Log, but couldnt find in database.

I have given below the web.config as well as Event Log.

Kindly help me to find out the reason asap.

EVENT LOG:

Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 7/29/2011 8:16:11 PM

Event time (UTC): 7/29/2011 2:46:11 PM

Event ID: 59e8e9078bb64655b48ed92311abf331

Event sequence: 25

Event occurrence: 1

Event detail code: 0 

Application information:

   Application domain: /LM/w3svc/1/ROOT/ITSSMetricsDashboard-5-129564238801557408

   Trust level: Full

   Application Virtual Path: /ITSSMetricsDashboard

   Application Path: C:\Projects\Corporate ITSS Metrics Dashboard\Corporate ITSS Metrics Dashboard\ITSSMetricsDashboard\

   Machine name: SOPHIHOME 

Process information:

   Process ID: 3316

   Process name: w3wp.exe

   Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information:

   Exception type: HttpException

   Exception message: Response is not available in this context. 

Request information:

   Request URL:

   Request path:

   User host address:

   User:

   Is authenticated: False

   Authentication Type:

   Thread account name: NT AUTHORITY\NETWORK SERVICE

 

Thread information:

   Thread ID: 7

   Thread account name: NT AUTHORITY\NETWORK SERVICE

   Is impersonating: False

   Stack trace:   at System.Web.HttpApplication.get_Response()

   at ASP.global_asax.Session_End(Object sender, EventArgs e) in C:\Projects\Corporate ITSS Metrics Dashboard\Corporate ITSS Metrics Dashboard\ITSSMetricsDashboard\global.asax:line 47

 Custom event details: 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

WEB.CONFIG:

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
 <configSections>
  <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  <sectionGroup name="ajaxNet">
   <section name="ajaxSettings" type="AjaxPro.AjaxSettingsSectionHandler,AjaxPro.2" requirePermission="false" restartOnExternalChanges="true"/>
  </sectionGroup>
 </configSections>
 <cachingConfiguration defaultCacheManager="Cache Manager">
  <cacheManagers>
   <add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage" name="Cache Manager"/>
  </cacheManagers>
  <backingStores>
   <add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Null Storage"/>
  </backingStores>
 </cachingConfiguration>
 <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="" logWarningsWhenNoCategoriesMatch="true">
  <listeners>
   <add databaseInstanceName="Exception Log" writeLogStoredProcName="usp_Log_Insert_Log" addCategoryStoredProcName="usp_Log_Add_Category" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Database Trace Listener"/>
   <add databaseInstanceName="Event Log" writeLogStoredProcName="usp_Log_Insert_Log" addCategoryStoredProcName="usp_Log_Add_Category" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Event Log Listener"/>
  </listeners>
  <formatters>
   <add template="Message: {message}&#xA;Category: {category}&#xA;Priority: {priority}&#xA;EventId: {eventid}&#xA;Severity: {severity}&#xA;Title:{title}&#xA;Machine: {machine}&#xA;Application Domain: {appDomain}&#xA;Process Id: {processId}&#xA;Process Name: {processName}&#xA;Win32 Thread Id: {win32ThreadId}&#xA;Thread Name: {threadName}&#xA;Extended Properties: {dictionary({key} - {value}&#xA;)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Text Formatter"/>
  </formatters>
  <categorySources>
   <add switchValue="All" name="Data Access Layer Exceptions">
    <listeners>
     <add name="Database Trace Listener"/>
    </listeners>
   </add>
   <add switchValue="All" name="Event">
    <listeners>
     <add name="Event Log Listener"/>
    </listeners>
   </add>
   <add switchValue="All" name="Web Service Access Layer Exceptions">
    <listeners>
     <add name="Database Trace Listener"/>
    </listeners>
   </add>
   <add switchValue="All" name="Web UI Layer Exception">
    <listeners>
     <add name="Database Trace Listener"/>
    </listeners>
   </add>
  </categorySources>
  <specialSources>
   <allEvents switchValue="All" name="All Events"/>
   <notProcessed switchValue="All" name="Unprocessed Category"/>
   <errors switchValue="All" name="Logging Errors &amp; Warnings"/>
  </specialSources>
 </loggingConfiguration>
 <exceptionHandling>
  <exceptionPolicies>
   <add name="Data Access Layer Policy">
    <exceptionTypes>
     <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception">
      <exceptionHandlers>
       <add logCategory="Data Access Layer Exceptions" eventId="1000" severity="Error" title="Data Access Exception" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Logging Handler"/>
      </exceptionHandlers>
     </add>
    </exceptionTypes>
   </add>
   <add name="Web Service Access Layer Policy">
    <exceptionTypes>
     <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception">
      <exceptionHandlers>
       <add logCategory="Web Service Access Layer Exceptions" eventId="3000" severity="Error" title="Web Service Exception" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Logging Handler"/>
      </exceptionHandlers>
     </add>
    </exceptionTypes>
   </add>
   <add name="Web UI Layer Policy">
    <exceptionTypes>
     <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception">
      <exceptionHandlers>
       <add logCategory="Web UI Layer Exception" eventId="2000" severity="Error" title="Web UI Exception" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Logging Handler"/>
      </exceptionHandlers>
     </add>
    </exceptionTypes>
   </add>
  </exceptionPolicies>
 </exceptionHandling>
 <appSettings>
  <add key="ApplicationName" value="Corporate ITSS Metrics Dashboard"/>
  <add key="ExpiredTargetBufferMonths" value="2"/>
  <!--local="Development"-->
  <!--Dev="Development"-->
  <!--Test="Test"-->
  <!--Prod="Production"-->
  <add key="Security" value="Development"/>
    <add key="HardCodedNetworkID" value="naipaper\nramakr"/>
  <add key="SessionTimeOut" value="45"/>
  <add key="ApplicationVirtualName" value="ITSSMetricsDashboard"/>
  <add key="IsSSLEnabled" value="FALSE"/>
  <!--<add key="HardCodedNetworkID" value="naipaper\1f9RAD1"/>-->
 </appSettings>
 <connectionStrings>
  <add name="ITSS Metrics" connectionString="Database=db_ITSS_Metrics;Server=164.103.197.37;UID=radsqluser;Password=rads98*mi3;Connect Timeout=120;" providerName="System.Data.SqlClient"/>
  <add name="Audit Log" connectionString="Database=db_ITSS_Metrics;Server=s02asqld2;UID=radsqluser;Password=rads98*mi3;Connect Timeout=20;" providerName="System.Data.SqlClient"/>
  <add name="Event Log" connectionString="Database=db_ITSS_Metrics;Server=s02asqld2;UID=radsqluser;Password=rads98*mi3;Connect Timeout=20;" providerName="System.Data.SqlClient"/>
  <add name="Exception Log" connectionString="Database=db_ITSS_Metrics;Server=s02asqld2;UID=radsqluser;Password=rads98*mi3;Connect Timeout=20;" providerName="System.Data.SqlClient"/>
  <add name="NorthwindConnectionString" connectionString="Data Source=s02asqld2;Initial Catalog=Northwind;Persist Security Info=True;User ID=radsqluser;Password=rads98*mi3" providerName="System.Data.SqlClient"/>
  <add name="PubsConnectionString" connectionString="Data Source=s02asqld2;Initial Catalog=Pubs;Persist Security Info=True;User ID=radsqluser;Password=rads98*mi3" providerName="System.Data.SqlClient"/>
  <add name="db_MetricsConnectionString" connectionString="Database=db_ITSS_Metrics;Server=s02asqld2;UID=radsqluser;Password=rads98*mi3;Connect Timeout=120;" providerName="System.Data.SqlClient"/>
 </connectionStrings>
 <system.web>
  <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
  <!--<sessionState timeout="30" regenerateExpiredSessionId ="true" />-->
  <customErrors mode="Off" defaultRedirect="App_Common/Exception.aspx">
   <error statusCode="404" redirect="App_Common/404.aspx"/>
  </customErrors>
  <siteMap defaultProvider="Top_Nav_Full_Width_Secondard_Menu">
   <providers>
    <add name="Top_Nav_Full_Width_Secondard_Menu" type="System.Web.XmlSiteMapProvider" siteMapFile="Web.sitemap"/>
   </providers>
  </siteMap>
  <compilation debug="true">
   <assemblies>
    <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
   </assemblies>
   <buildProviders>
    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     <remove extension=".rdlc"/> <!-- Added to disallow rdlc file towards getting compiled -->
   </buildProviders>
  </compilation>
  <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
  <pages theme="ITSSMetricsTheme" styleSheetTheme="ITSSMetricsTheme" enableEventValidation="false">
   <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add tagPrefix="csla" namespace="Csla.Web" assembly="Csla"/>
    <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
    <add tagPrefix="rads" namespace="IP.RADS.Web.Controls.AjaxValidator" assembly="AjaxValidator"/>
    <add tagPrefix="ew" namespace="eWorld.UI" assembly="eWorld.UI"/>
   </controls>
   <namespaces>
    <clear/>
    <add namespace="System"/>
    <add namespace="System.Collections"/>
    <add namespace="System.Collections.Specialized"/>
    <add namespace="System.Configuration"/>
    <add namespace="System.Text"/>
    <add namespace="System.Text.RegularExpressions"/>
    <add namespace="System.Web"/>
    <add namespace="System.Web.Caching"/>
    <add namespace="System.Web.SessionState"/>
    <add namespace="System.Web.Security"/>
    <add namespace="System.Web.Profile"/>
    <add namespace="System.Web.UI"/>
    <add namespace="System.Web.UI.WebControls"/>
    <add namespace="System.Web.UI.WebControls.WebParts"/>
    <add namespace="System.Web.UI.HtmlControls"/>
   </namespaces>
  </pages>
  <authentication mode="Windows"/>
  <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
  <httpHandlers>
   <remove verb="*" path="*.asmx"/>
   <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add path="ajaxpro/*.ashx" verb="POST,GET" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
   <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
   <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" validate="false"/>
  </httpHandlers>
  <httpModules>
   <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </httpModules>
 </system.web>
 <system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <modules>
   <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </modules>
  <handlers>
   <remove name="WebServiceHandlerFactory-Integrated"/>
   <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </handlers>
 </system.webServer>
</configuration>

Jul 31, 2011 at 7:19 AM

Hi,

Can any one please suggest me how to resolve this?

Aug 1, 2011 at 9:31 AM

Hi,

I have answered the same question from another thread.

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
Contact Us