void Application_PostRequestHandlerExecute(Object sender, EventArgs e) { #if DEBUG #else // Get Elmah to log all our post requests string postlogpath = System.Configuration.ConfigurationManager.AppSettings["PostLogPath"] ?? HttpContext.Current.Request.PhysicalApplicationPath + "/PostLogs/"; Elmah.XmlFileErrorLog xmlErrorLog = new Elmah.XmlFileErrorLog(postlogpath); xmlErrorLog.Log(new Elmah.Error(new Exception("POST"), System.Web.HttpContext.Current)); #endif }
private static IServiceProvider ElmahServiceProviderQueryHandler(object context) { var container = new ServiceContainer(context as IServiceProvider); var log = new XmlFileErrorLog(HttpContext.Current.Server.MapPath("~/KIM_ELAMH/")); log.ApplicationName = "SysCore"; container.AddService(typeof(ErrorLog), log); // var mail=Elmah.m return container; }