500pts: Advice with a Log class i have created, use static ? lock necessary?
Posted on 2006-11-08
I wonder if anyone can help i have created some webservices and in there is a separate class called "LOG" which basically writes to a text file when an error occurs...
I have created it as static methods so i don't need a reference but then of course i could always create a variable in global.asax and create a reference to it...
Just not too sure which is better,
also i am a little worried that more than one session accesses the log at the same time, is this something i can use lock or something for??
my log class as 3 methods, Open, writeError, and Close..... how would i implement a lock... before callign OPEN do i use lock (className) and then after Close somehow unlock it??
A little confused, any ideas really apprecaited
Thanks in advance