views:

134

answers:

1

I'm using Enterprise Library 3.1 for logging exception for some web application. All exception should be written to a single xml file (say Errors.xml) on the same server the application run. The problem that sometime in addition to Errors.xml I see files with names like this: 7b53e14b-4b92-43b5-94a0-09666f1c8c4c**ServerName**.xml where ServerName is name of the server. These file are usually small (50kb), but are some with 500kb size. The code that writes an exception to a log is next:

...
SyncLock threadlock // static variable
    ExceptionPolicy.HandleException(ex, "Global Policy")
End SyncLock
...

I can't understand why all these strange files are created. Can somebody help with this?

+1  A: 

http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=29005, see second comment by user fsimonazzi:

"Regarding the GUID prefix, that's expected when two different trace listener instances open the same file. If the container and the facades are using the same configuration, the container managed instance and the factory created one will try to write to the same file and one of them will add the GUID prefix when it finds the file cannot be opened."

The reason you have multiple trace listerner instances is because you have multiple users accessing your webapp.

Ian Kemp
Thanks, interesting link. Looks like this issue should be fixed in 4.1 version.
Kamarey