public ActionResult Index() { ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; LogError("lok", "lok2", "lok3"); return View(); }
private void LogError(string transactionId, string sAmountPaid, string deviceId) { // Creating the source, which will generate error if (!EventLog.SourceExists("MyApplication")) { //Creating log, where error will be logged EventLog.CreateEventSource("MyApplication", "MyLog"); } // Creating object of EventLog to log error var myAppLog = new EventLog { Source = "MyApplication" }; //Writing error to log myAppLog.WriteEntry(transactionId + sAmountPaid + deviceId); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)