public XElement toXElement(LogEventInfoEx[] logEventInfo)
 {
     var elements = new XElement[logEventInfo.Length];
     for (var i = 0; i < logEventInfo.Length; i++)
     {
         elements[i] = toXElement(logEventInfo[i]);
     }
     return new XElement("logMessages", elements);
 }
 protected override void Write(LogEventInfo info)
 {
     lock (logEventQueue)
     {
         var infoEx = new LogEventInfoEx();
         infoEx.V        = info;
         infoEx.threadID = Thread.CurrentThread.ManagedThreadId;
         logEventQueue.Enqueue(infoEx);
     }
 }
 protected override void Write(LogEventInfo info)
 {
     lock (logEventQueue)
     {
         var infoEx = new LogEventInfoEx();
         infoEx.V = info;
         infoEx.threadID = Thread.CurrentThread.ManagedThreadId;
         logEventQueue.Enqueue(infoEx);
     }
 }
 public XElement toXElement(LogEventInfoEx logEventInfo)
 {
     var time = logEventInfo.V.TimeStamp;
     var timeString = time.ToString(timeFormat);
     return new XElement("logMessage",
         new XAttribute("time", timeString),
         new XAttribute("level", logEventInfo.V.Level),
         new XAttribute("name", logEventInfo.V.LoggerName),
         new XAttribute("message", logEventInfo.V.Message),
         new XAttribute("threadID", logEventInfo.threadID)
     );
 }
Exemple #5
0
        public XElement toXElement(LogEventInfoEx logEventInfo)
        {
            var time       = logEventInfo.V.TimeStamp;
            var timeString = time.ToString(timeFormat);

            return(new XElement("logMessage",
                                new XAttribute("time", timeString),
                                new XAttribute("level", logEventInfo.V.Level),
                                new XAttribute("name", logEventInfo.V.LoggerName),
                                new XAttribute("message", logEventInfo.V.Message),
                                new XAttribute("threadID", logEventInfo.threadID)
                                ));
        }