tobbbe
1/18/2017 - 11:40 AM

error log

public static void LogError (string errorMsg)
{
    string path = HttpContext.Current.Server.MapPath("/App_Data/errorlog.txt");

    using (StreamWriter sw = File.AppendText(path))
    {
        sw.WriteLine(DateTime.Now + " : " + errorMsg + Environment.NewLine + Environment.NewLine);
    }
}