Locked AppFabric Newbie WriteErrorEvent

  • Tuesday, December 06, 2011 5:16 PM
     
     

    Hello,

    I am wondering why my catch block does not write an error event? If I use the first overload it works but the others do not???

    For example no try catch block and no error recorded in the AppFabric dashboard with EndToEnd Monitoring.

     throw new System.DivideByZeroException("Test 2");

     

    If we add a try catch block and write a custom error event it doesn't record.

     try
    {
         //result = n1 + n2;
         throw new System.DivideByZeroException("Test 2");
    }

    catch (DivideByZeroException e)
    {
         LoggingEventProvider.WriteErrorEvent("CTL_AddMethod_DivideByZero_Exception", "The values involved are {0}, {1}.", n1,n2);
         //LoggingEventProvider.WriteErrorEvent(e);
                   
    }

     

    but if we dump the exception it does write the error?

    catch (DivideByZeroException e)
    {
              LoggingEventProvider.WriteErrorEvent(e);      
    }

     What am I missing?

    TIA

    JB


    • Edited by zzpluralza Tuesday, December 06, 2011 5:21 PM
    •  

All Replies

  • Friday, December 09, 2011 4:45 PM
     
     

    I figured it out but still not sure why. I had typod the ErrorEventId = 319 when it should have been 301. So it works now but wondering why. I mean if the record was entered into the database as 319 sure it might not show in the AppFabric dashboard but when I queried the table directly from SSMS it wasn't even in the db?

    Somewhere along the way the record is not entered into the db because that ErrorEventID doesn't match?????

     

    JB

  • Friday, December 09, 2011 11:32 PM
    Moderator
     
     

    That does seem weird, it is possible this could be a bug. I am going to try to find a sample of how it is recommended this be done.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
  • Friday, December 09, 2011 11:40 PM
    Moderator
     
     

    Is LoggingEventProvider a custom class for you? I cannot find the information on this. I did see this on custom tracking: http://go.microsoft.com/fwlink/?LinkId=160077

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline