Dofactory.com
Dofactory.com
 Back to list
Views:   12.8K
Replies:  3
Archived

File locking question

In my ASP.NET  application I log all the exceptions to a log file.
This can be a issue when multiple requests try to write at the same time to the log file. 
How is this scenario best handled? 
Rahul Sabharwal, Jul 25, 2010
Reply 1
Another popular logging framework is Log4net. http://logging.apache.org/log4net/


Andrew Green, Jul 29, 2010
Reply 2
Lock code block which has been used to write log to the file using "lock Statement". This statement would not been executed until previous execution has been completed.

For detail visit http://msdn.microsoft.com/en-us/library/c5kehkcz(VS.80).aspx link.
Mihir Vinchhi, Jul 29, 2010
Reply 3
You may use the Enterprise Library from Codeplex for your scenario. It has all the patterns implemented to handle the mutithreaded scenario like yours.
Sreenivas Manyam Rajaram, Jul 26, 2010
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.