I have a problem when using essential diagnostics' RollingFileTraceListener in an ASP.NET MVC 3 app. During application pool recycling, IIS 6 creates a new process while keeping the old process alive until the old process finished servicing all pending requests.
I found a documentation of it at this link:
So, during app pool recycling there are two processes running and if both processes try to write to the same log file, one process will fail, usually the new process, until the old process is terminated.
Is it possible to modify RollingFileTraceListener to use mutex or release the write lock when not writing to the log file so both processes can write to the same log file?
Or is there a better way?