Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public void logError(string vstrLogEntry, Exception ex)
 {
     JELog logging = new JELog(xdoc, user.username, vstrLogEntry + ", " + ex.Message + ": " + ex.StackTrace, SEVERITY_ERROR.ToString(), this.strJELogFile);
 }
Пример #4
0
 public void logError(string vstrLogEntry)
 {
     JELog logging = new JELog(xdoc, user.username, vstrLogEntry, SEVERITY_ERROR.ToString(), this.strJELogFile);
 }