Concurrent File access in Logging

Topics: Logging Application Block
Apr 20, 2009 at 8:44 AM
I'm having a look at the LogWriter class in the Logging application block.
Can someone please explain to me how this code handles concurrent file access when several applications try to log to the same file simultaneously?

Thanks
Apr 20, 2009 at 8:54 AM
When two tracelisteners are accessing the files concurrently (regardless whether they are from 2 different application), the behavior is that the second one creates another file prefixed with GUID.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Apr 20, 2009 at 9:07 AM
Thanks Sarah. Would you know if we can add the GUID by postfixing as apposed to prefix?
Apr 20, 2009 at 9:11 AM
I don't think so, that behavior is defined by the TextWriterTraceListener and not something controlled by entlib.  EntLib provides a facility though in order for you to avoid having guid-named files by using the Distributor Service.  Using it is included in the documentation.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com