471,594 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

EnterpriseLibrary 2.0 Exception and logging block

Please help me in resolving this issue.
I am using EnterpriseLibrary 2.0 Exception and logging block for
logging exceptions to event log. It works fine for sometime. After some
time it stops logging to event log. To make it active again I need to
open the web.config and save without making any changes. It starts to
work again.

Here is the configuration I am using.

<exceptionHandling>
<exceptionPolicies>
<add name="My Policy">
<exceptionTypes>
<add name="System Exception" type="System.Exception, mscorlib"
postHandlingAction="None">
<exceptionHandlers>
<add logCategory="ExceptionBlockCategory" eventId="100"
severity="Error" title="App Admin" priority="0"
formatterType="Microsoft.Practices.EnterpriseLibra ry.ExceptionHandling.TextExceptionFormatter,
Microsoft.Practices.EnterpriseLibrary.ExceptionHan dling" name="Logging
Handler"
type="Microsoft.Practices.EnterpriseLibrary.Except ionHandling.Logging.LoggingExceptionHandler,
Microsoft.Practices.EnterpriseLibrary.ExceptionHan dling.Logging"></add>
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>
<loggingConfiguration defaultCategory="ExceptionBlockCategory"
tracingEnabled="true">
<categorySources>
<add name="ExceptionBlockCategory" switchValue="All">
<listeners>
<add name="ExceptionBlockEventListener"/>
</listeners>
</add>
<add switchValue="All" name="Trace">
<listeners>
<add name="FlatFile TraceListener"/>
</listeners>
</add>
</categorySources>
<specialSources>
<errors name="errors" switchValue="All">
<listeners>
<add name="ExceptionBlockErrorListener"/>
<add name="FlatFile TraceListener"/>
</listeners>
</errors>
</specialSources>
<listeners>
<add name="ExceptionBlockEventListener"
type="Microsoft.Practices.EnterpriseLibrary.Loggin g.TraceListeners.FormattedEventLogTraceListener,
Microsoft.Practices.EnterpriseLibrary.Logging"
listenerDataType="Microsoft.Practices.EnterpriseLi brary.Logging.Configuration.FormattedEventLogTrace ListenerData,
Microsoft.Practices.EnterpriseLibrary.Logging" source="Priya"
formatter="ExceptionBlockFormatter"/>
<add name="ExceptionBlockErrorListener"
type="Microsoft.Practices.EnterpriseLibrary.Loggin g.TraceListeners.FormattedEventLogTraceListener,
Microsoft.Practices.EnterpriseLibrary.Logging"
listenerDataType="Microsoft.Practices.EnterpriseLi brary.Logging.Configuration.FormattedEventLogTrace ListenerData,
Microsoft.Practices.EnterpriseLibrary.Logging" source="Application"
formatter="ExceptionBlockFormatter"/>
<add name="FlatFile TraceListener" fileName="trace.log"
header="----------------------------------------"
footer="----------------------------------------" formatter="Trace
Format"
listenerDataType="Microsoft.Practices.EnterpriseLi brary.Logging.Configuration.FlatFileTraceListenerD ata,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null" traceOutputOptions="None"
type="Microsoft.Practices.EnterpriseLibrary.Loggin g.TraceListeners.FlatFileTraceListener,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null" />
</listeners>
<formatters>
<add name="ExceptionBlockFormatter"
type="Microsoft.Practices.EnterpriseLibrary.Loggin g.Formatters.TextFormatter,
Microsoft.Practices.EnterpriseLibrary.Logging" template="Timestamp:
{timestamp}&#xA; 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; )}"/>
<add template="Timestamp: {timestamp}&#xA; [Title: {title}]
&#xA;Message: {message}&#xA;"
type="Microsoft.Practices.EnterpriseLibrary.Loggin g.Formatters.TextFormatter,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null" name="Trace Format"/>
</formatters>
</loggingConfiguration>
Please help.

Nov 7 '06 #1
0 1971

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Kevin Jackson | last post: by
3 posts views Thread by Ben | last post: by
17 posts views Thread by Cramer | last post: by
7 posts views Thread by Ralf Jansen | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.