Logging Block not inserting in SQLDB

Topics: Logging Application Block
Jan 19, 2010 at 1:06 AM

Hi,

I'm using the logging block with a DB tracer but events are not being inserted at all.

I set up a user in the db and the credentials are correct in the connection string. Configuration seems fine as well (will paste in the end of this post).

Is there a way I can tell the logging block to let any SQL Exceptions be thrown out so I can see what's happening?

 

Thanks in advance,

<

loggingConfiguration name="Logging Application Block" tracingEnabled="true"

 

<

<

defaultCategory="SystemEvent" logWarningsWhenNoCategoriesMatch="true">listeners>add toAddress="antonio.tirado@vedaadvantage.com; greg.lyons@vedaAdvantage.com"

 

fromAddress="antonio.tirado@vedaAdvantage.com" subjectLineStarter="VedaSearch error log. Severity: "

 

subjectLineEnder="" smtpServer="mail3.corp.dmz" smtpPort="25"

 

formatter="Error Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

 

traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

 

<

name="Error Email" />add databaseInstanceName="LCADB" writeLogStoredProcName="WriteLog"

 

addCategoryStoredProcName="AddCategory" formatter="Info 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="Log Event" />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="Error Formatter" />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="Info Formatter" />formatters>logFilters>add categoryFilterMode="DenyAllExceptAllowed" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.CategoryFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

 

<

<

<

<

</

</

</

<

<

<

<

<

</

</

<

<

<

</

</

<

<

<

<

</

</

</

<

<

<

<

</

</

<

<

name="Category Filter">categoryFilters>add name="SearchEvent" />add name="ErrorEvent" />add name="SystemEvent" />categoryFilters>add>logFilters>categorySources>add switchValue="All" name="ErrorEvent">listeners>add name="Error Email" />add name="Log Event" />listeners>add>add switchValue="ActivityTracing" name="SearchEvent">listeners>add name="Log Event" />listeners>add>add switchValue="ActivityTracing" name="SystemEvent">listeners>add name="Error Email" />add name="Log Event" />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>connectionStrings>add name="LCADB" connectionString="Data Source=10.1.206.35;Initial Catalog=LCA;User ID=xxxyyyy;Password=xxxyyyy;Application Name=xxxyyyy"

 

</

providerName="System.Data.SqlClient" />connectionStrings>

Jan 19, 2010 at 4:59 AM

nvm, I got it to work.

 

Thanks anyways

Jan 21, 2010 at 6:19 PM

hi,

 

how you solve your problem.. i am also facing the same problem...

 

Jan 22, 2010 at 3:34 AM

Hi,

First things to check:

  1. Valid connection string.
  2. access to the database server.
  3. The database instance that is associated with the db trace listener is correct.

You can also diagnose it by adding a event log trace listener in the errors & warning section of the LAB in the config. When a exception occurs during the logging process, you'll see the exception logged in the event viewer.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com