Webform Log file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a class to log application event in my webform.
This "Logs" class contains only one static method :

static void WriteLog(string mess)
{
StreamWriter log
log = File.AppendText("file.log");
log.WriteLine(mess);
log.Flush();
log.Close();
}

Logs.WriteLog() is called in the codebehing of my WebForm

Several WebForm can call simultaneously the WriteLog method.
What appends if several people call my Webform at the same time ?
deadlock or Exception ? Or others problems ?

Is it necessary to had a lock(this) around my WriteLog code ?

Thanks

Christian
 
Back
Top