using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Web;

namespace BookShopOnline.Utility
{
    public class ErrorLog
    {
        private static readonly string filePath = @"~/ErrorLog/errorlog.txt";

        public static void WriteErrorLog(Exception ex)
        {
            using (StreamWriter sw = new StreamWriter(HttpContext.Current.Server.MapPath(filePath), true,Encoding.Default))
            {
                sw.WriteLine(DateTime.Now.ToString()+Environment.NewLine+ex.InnerException.Message+Environment.NewLine);
            }
        }
    }
}
