Наследование: INiLogEvent
Пример #1
0
            protected override void Append(LoggingEvent loggingEvent)
            {
                var logEvent = new NiLogEvent
                {
                    Message   = loggingEvent.RenderedMessage,
                    Severity  = GetSeverity(loggingEvent.Level),
                    Source    = loggingEvent.LoggerName,
                    TimeStamp = loggingEvent.TimeStamp
                };

                if (loggingEvent.ExceptionObject != null)
                {
                    var sb = new StringBuilder();

                    GetExceptionLog(loggingEvent.ExceptionObject, sb);

                    logEvent.Content = sb.ToString();
                }

                ErrorUtil.ThrowOnFailure(_logger.Append(logEvent));
            }
Пример #2
0
            protected override void Append(LoggingEvent loggingEvent)
            {
                var logEvent = new NiLogEvent
                {
                    Message = loggingEvent.RenderedMessage,
                    Severity = GetSeverity(loggingEvent.Level),
                    Source = loggingEvent.LoggerName,
                    TimeStamp = loggingEvent.TimeStamp
                };

                if (loggingEvent.ExceptionObject != null)
                {
                    var sb = new StringBuilder();

                    GetExceptionLog(loggingEvent.ExceptionObject, sb);

                    logEvent.Content = sb.ToString();
                }

                ErrorUtil.ThrowOnFailure(_logger.Append(logEvent));
            }