Exception Logging does not include Logger.SetContextItem() values

Topics: Exception Handling Application Block, Logging Application Block
Jun 3, 2009 at 7:11 PM

Im using Logger.SetContextItem() to specify values to record with each log entry such as Customer, User, etc... This works great when performing normal logging but the Context Items dont get written when Exceptions are logged as I would expect they should.

1) Is this the intended behaviour? -- that Exception Logging does not obtain the values specified via Logger.SetContextItem()
    A) If so, what would be the recommended way to add the functionality?
        i) implement a Logger.GetContextItems() that can be used to retreive them and then add them to the exception in each catch block?
        ii) change the exception handling or logging block?? ugh..

BTW, im currently using Entlib 3.1

Thanks in advance :)

Jun 3, 2009 at 10:03 PM

Nevermind.. This DOES WORK.. I found the issue in my code :)