Exception and Logging

Topics: Exception Handling Application Block, General discussion, Logging Application Block
Jun 17, 2008 at 5:18 PM
I'm using Exception and logging blocks from Entlib 3.1 . I have a web service application developed in .net 2.0 .  I'm trying to have a Category, say "category1" to Log the information. Then i created a Exception and in its LogCategory i selected the category which i gave for Logging, that is "category1". Thinking that both exception and Logging will log in the same file. Is this not possible with Entlib or am i missing anything ? Please let me know.

The current behaviour 
the exceptions are logging properly .Below is the sample code how i use exception block.
ExceptionPolicy.HandleException(ex, "category1");

The logging is giving problem. It creates a new file every time i try to log. It appends a guid as part of the file name it creates. Below is the sample code i use to log.
Logger.Write(message, "category1", 1, 1, TraceEventType.Information);
Jun 17, 2008 at 8:57 PM
Hi,

That's a known issue http://www.codeplex.com/entlib/WorkItem/View.aspx?WorkItemId=10278, and there is a fix for it in v4. There are some workarounds if you're willing to update the source code and use non-ms-signed binaries.

Fernando


APeter wrote:
I'm using Exception and logging blocks from Entlib 3.1 . I have a web service application developed in .net 2.0 .  I'm trying to have a Category, say "category1" to Log the information. Then i created a Exception and in its LogCategory i selected the category which i gave for Logging, that is "category1". Thinking that both exception and Logging will log in the same file. Is this not possible with Entlib or am i missing anything ? Please let me know.

The current behaviour 
the exceptions are logging properly .Below is the sample code how i use exception block.
ExceptionPolicy.HandleException(ex, "category1");

The logging is giving problem. It creates a new file every time i try to log. It appends a guid as part of the file name it creates. Below is the sample code i use to log.
Logger.Write(message, "category1", 1, 1, TraceEventType.Information);


Jun 18, 2008 at 3:12 AM
Kindly let me know the work around.

Thanks
-Aaron
Jun 18, 2008 at 12:43 PM
It's linked in my previous answer... http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=25021

Fernando


APeter wrote:
Kindly let me know the work around.

Thanks
-Aaron


Jun 18, 2008 at 4:22 PM
I did made the changes as per your instructions.

I used "BuildLibraryAndCopyAssemblies.bat Release" to build the project. There were no build errors and asssemblies got copied also. Since i have VS2008 , i went with batch build.

But still the problem exists. Anything i'm missing ?
Jun 18, 2008 at 8:38 PM

Sorry the fix is working fine. Forgot to update my local copy.

Thanks for the time and help.