Intermittent Error: Tracing to LogSource 'General' failed

Topics: Logging Application Block
May 27, 2010 at 3:50 AM
Edited May 27, 2010 at 4:07 PM

I've configured my application's log file and most of the time it works great.  but lately, periodically seeing the following in my logs:

Tracing to LogSource 'General' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the config...

Here's the odd part,

Both my general category listener and my error listener use the same database listener.  If the problem were truly a configuration issue I would think:

  1. The general listeners would constantly fail.  This isn't the case, as I it works for a while, then generates a series of these error messages, then resumes working for a while.
  2. Both the General Category and the Special Source Error Cateogry are configured to use the same database listener.  If the database connectionstring was invalid I wouldn't get any messages logged from the general category (which I am), nor would I get the error messages themselves logged (which I am).

Given the intermittent nature of the problem, I think I can rule an invalid as the cause of this problem. 

How can I troubleshoot the cause of this problem further?

(I'm using Enterprise Framework 4.1.0)

Configuration Follows

<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="false">
  <listeners>
    <add source="Enterprise Library Logging" formatter="Text Formatter"
      log="Application" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
      traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
      name="Formatted EventLog TraceListener" />
    <add fileName="c:\logs\sts\FrameworkServices.Identity.STS.log" footer="----------------------------------------"
      formatter="Text Formatter" header="----------------------------------------"
      rollFileExistsBehavior="Increment" rollInterval="None" rollSizeKB="2000"
      timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
      traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
      name="Rolling File TraceListener" />
    <add fileName="c:\logs\sts\FrameworkServices.Services.Identity.STS.log" footer="----------------------------------------"
     formatter="Text Formatter" header="----------------------------------------"
     rollFileExistsBehavior="Increment" rollInterval="None" rollSizeKB="2000"
     timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
     traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
     name="General Rolling File TraceListener" />
    <add databaseInstanceName="LoggingDatabase" writeLogStoredProcName="WriteLog"
     addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
     listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
     traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
     name="Database Trace Listener" />

  </listeners>
  <formatters>
    <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
      type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
      name="Text Formatter" />
  </formatters>
  <logFilters>
    <!--<add categoryFilterMode="AllowAllExceptDenied" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.CategoryFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
        name="Category">
        <categoryFilters>
          <add name="UI Events" />
        </categoryFilters>
      </add>-->
    <!--<add minimumPriority="2" maximumPriority="2147483647" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.PriorityFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
        name="Priority" />-->
    <add enabled="true" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.LogEnabledFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"
      name="LogEnabled Filter" />
  </logFilters>
  <categorySources>
    <add switchValue="All" name="General">
      <listeners>
         <add name="Rolling File TraceListener" />
            <add name="Database Trace Listener" />
      </listeners>
    </add>
    <!--<add switchValue="All" name="NotificationRequest">
      <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">
      <listeners>
        <add name="General Rolling File TraceListener" />
          <add name="Database Trace Listener" />
      </listeners>
    </errors>
  </specialSources>
</loggingConfiguration>

 

May 27, 2010 at 4:09 AM

Did you read further the logs you're getting in, I assume, the file specified in the General Rolling File TraceListener?  Usually it includes a more detailed information on what was the cause of the logging failure.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com 

May 27, 2010 at 4:09 PM

Thanks for the Tip.  Checking the rolling log file did indeed show me additional logged error messages.  Apparently the Database log writer is having intermittent issues connecting to my SqlServer.

The log revealed a SQL Exception wth the message: "provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified"

I'm begin work to resolve this issue.