To Handle the error in my web application
I am Creating a log file which will be created in Application_Error() event of global.asax
and Those log file created based on date (1 per day)
I am Considering scenario where error occured and at same instance of time
file getting write from multiple users at same time
so it may throw exception that file already being used by another user
it may be like that i am not sure
can anybody help to deal with such scenario
many thanks
Use
mutexto lock your writing procedure. I suggestmutex, and notlock()because can catch all pools/threads that may throw an error.On MSDN there are the details about
mutexand examples:http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx
a simple example