public JELog(string rstrJELogfile, string strUsername, string strEntry, string strDate, string strSeverity) { XDocument xDoc = new XDocument(); xDoc = XDocument.Load(rstrJELogfile); int childrenCount = getCount(xDoc); var jeLog = new JELog(); jeLog.id = childrenCount + 1; jeLog.date = strDate; jeLog.username = strUsername; jeLog.entry = strEntry; jeLog.severity = strSeverity; XElement logEntry = new XElement("logentry"); logEntry.Add(new XElement("id", jeLog.id)); logEntry.Add(new XElement("date", jeLog.date)); logEntry.Add(new XElement("entry", jeLog.entry)); logEntry.Add(new XElement("username", jeLog.username)); logEntry.Add(new XElement("severity", jeLog.severity)); xDoc.Element("logentries").Add(logEntry); xDoc.Save(rstrJELogfile); }
public JELog(XDocument xdoc, string username, string logentry, string strSeverity, string rstrJELogfile) { int childrenCount = getCount(xdoc); var jeLog = new JELog(); jeLog.id = childrenCount + 1; jeLog.date = DateTime.Now.ToString(); jeLog.username = username; jeLog.entry = logentry; jeLog.severity = strSeverity; XElement logEntry = new XElement("logentry"); logEntry.Add(new XElement("id", jeLog.id)); logEntry.Add(new XElement("date", jeLog.date)); logEntry.Add(new XElement("entry", jeLog.entry)); logEntry.Add(new XElement("username", jeLog.username)); logEntry.Add(new XElement("severity", jeLog.severity)); xdoc.Element("logentries").Add(logEntry); xdoc.Save(rstrJELogfile); }
public void logError(string vstrLogEntry, Exception ex) { JELog logging = new JELog(xdoc, user.username, vstrLogEntry + ", " + ex.Message + ": " + ex.StackTrace, SEVERITY_ERROR.ToString(), this.strJELogFile); }
public void logError(string vstrLogEntry) { JELog logging = new JELog(xdoc, user.username, vstrLogEntry, SEVERITY_ERROR.ToString(), this.strJELogFile); }