Ejemplo n.º 1
0
        protected override void Append(LoggingEvent loggingEvent)
        {
            DgLogEntry newLogEntry = new DgLogEntry();

            newLogEntry.evdatetime = loggingEvent.TimeStamp;
            newLogEntry.level      = loggingEvent.Level.ToString();
            newLogEntry.logger     = loggingEvent.LoggerName;
            newLogEntry.message    = loggingEvent.MessageObject.ToString();
            newLogEntry.method     = loggingEvent.LocationInformation.MethodName;
            newLogEntry.line       = loggingEvent.LocationInformation.LineNumber;
            newLogEntry.classname  = loggingEvent.LocationInformation.ClassName;
            newLogEntry.thread     = loggingEvent.ThreadName;

            DgEventLog?.Add(newLogEntry);
        }
Ejemplo n.º 2
0
        protected override void Append(LoggingEvent loggingEvent)
        {
            DgLogEntry newLogEntry = new DgLogEntry();

            newLogEntry.evdatetime = loggingEvent.TimeStamp;
            newLogEntry.level      = loggingEvent.Level.ToString();
            newLogEntry.logger     = loggingEvent.LoggerName;
            newLogEntry.message    = loggingEvent.MessageObject.ToString();
            newLogEntry.method     = loggingEvent.LocationInformation.MethodName;
            newLogEntry.line       = loggingEvent.LocationInformation.LineNumber;
            newLogEntry.classname  = loggingEvent.LocationInformation.ClassName;
            newLogEntry.thread     = loggingEvent.ThreadName;

            Application.Current?.Dispatcher?.BeginInvoke(new Action(() => this.DgEventLog.Add(newLogEntry)));
        }