EnterpriseLibrary 2.0 Exception and logging block

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rajesh.hanchate@gmail.com

    #1

    EnterpriseLibrary 2.0 Exception and logging block

    Please help me in resolving this issue.
    I am using EnterpriseLibra ry 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.

    <exceptionHandl ing>
    <exceptionPolic ies>
    <add name="My Policy">
    <exceptionTypes >
    <add name="System Exception" type="System.Ex ception, mscorlib"
    postHandlingAct ion="None">
    <exceptionHandl ers>
    <add logCategory="Ex ceptionBlockCat egory" eventId="100"
    severity="Error " title="App Admin" priority="0"
    formatterType=" Microsoft.Pract ices.Enterprise Library.Excepti onHandling.Text ExceptionFormat ter,
    Microsoft.Pract ices.Enterprise Library.Excepti onHandling" name="Logging
    Handler"
    type="Microsoft .Practices.Ente rpriseLibrary.E xceptionHandlin g.Logging.Loggi ngExceptionHand ler,
    Microsoft.Pract ices.Enterprise Library.Excepti onHandling.Logg ing"></add>
    </exceptionHandle rs>
    </add>
    </exceptionTypes>
    </add>
    </exceptionPolici es>
    </exceptionHandli ng>
    <loggingConfigu ration defaultCategory ="ExceptionBloc kCategory"
    tracingEnabled= "true">
    <categorySource s>
    <add name="Exception BlockCategory" switchValue="Al l">
    <listeners>
    <add name="Exception BlockEventListe ner"/>
    </listeners>
    </add>
    <add switchValue="Al l" name="Trace">
    <listeners>
    <add name="FlatFile TraceListener"/>
    </listeners>
    </add>
    </categorySources >
    <specialSources >
    <errors name="errors" switchValue="Al l">
    <listeners>
    <add name="Exception BlockErrorListe ner"/>
    <add name="FlatFile TraceListener"/>
    </listeners>
    </errors>
    </specialSources>
    <listeners>
    <add name="Exception BlockEventListe ner"
    type="Microsoft .Practices.Ente rpriseLibrary.L ogging.TraceLis teners.Formatte dEventLogTraceL istener,
    Microsoft.Pract ices.Enterprise Library.Logging "
    listenerDataTyp e="Microsoft.Pr actices.Enterpr iseLibrary.Logg ing.Configurati on.FormattedEve ntLogTraceListe nerData,
    Microsoft.Pract ices.Enterprise Library.Logging " source="Priya"
    formatter="Exce ptionBlockForma tter"/>
    <add name="Exception BlockErrorListe ner"
    type="Microsoft .Practices.Ente rpriseLibrary.L ogging.TraceLis teners.Formatte dEventLogTraceL istener,
    Microsoft.Pract ices.Enterprise Library.Logging "
    listenerDataTyp e="Microsoft.Pr actices.Enterpr iseLibrary.Logg ing.Configurati on.FormattedEve ntLogTraceListe nerData,
    Microsoft.Pract ices.Enterprise Library.Logging " source="Applica tion"
    formatter="Exce ptionBlockForma tter"/>
    <add name="FlatFile TraceListener" fileName="trace .log"
    header="----------------------------------------"
    footer="----------------------------------------" formatter="Trac e
    Format"
    listenerDataTyp e="Microsoft.Pr actices.Enterpr iseLibrary.Logg ing.Configurati on.FlatFileTrac eListenerData,
    Microsoft.Pract ices.Enterprise Library.Logging , Version=2.0.0.0 ,
    Culture=neutral , PublicKeyToken= null" traceOutputOpti ons="None"
    type="Microsoft .Practices.Ente rpriseLibrary.L ogging.TraceLis teners.FlatFile TraceListener,
    Microsoft.Pract ices.Enterprise Library.Logging , Version=2.0.0.0 ,
    Culture=neutral , PublicKeyToken= null" />
    </listeners>
    <formatters>
    <add name="Exception BlockFormatter"
    type="Microsoft .Practices.Ente rpriseLibrary.L ogging.Formatte rs.TextFormatte r,
    Microsoft.Pract ices.Enterprise Library.Logging " template="Times tamp:
    {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}&#x A; Extended Properties: {dictionary({ke y} -
    {value}&#xA; )}"/>
    <add template="Times tamp: {timestamp}&#xA ; [Title: {title}]
    &#xA;Message : {message}&#xA;"
    type="Microsoft .Practices.Ente rpriseLibrary.L ogging.Formatte rs.TextFormatte r,
    Microsoft.Pract ices.Enterprise Library.Logging , Version=2.0.0.0 ,
    Culture=neutral , PublicKeyToken= null" name="Trace Format"/>
    </formatters>
    </loggingConfigur ation>


    Please help.

Working...