示例#1
0
        protected override void Write(LogEventInfo logEvent)
        {
            if (_logger == null)
            {
                _logger = new Logger(LogId);
            }

            var message = new Message(logEvent.FormattedMessage)
            {
                Severity = LevelToSeverity(logEvent.Level),
                DateTime = logEvent.TimeStamp.ToUniversalTime(),
                Detail = logEvent.Exception != null ? logEvent.Exception.ToString() : null,
                Data = PropertiesToData(logEvent.Properties)
            };

            _logger.Log(message);
        }
示例#2
0
        protected override void Write(LogEventInfo logEvent)
        {
            if (_logger == null)
            {
                _logger = new Logger(LogId);
            }

            var message = new Message(logEvent.FormattedMessage)
            {
                Severity                                   = LevelToSeverity(logEvent.Level),
                DateTime                                   = logEvent.TimeStamp.ToUniversalTime(),
                Detail                                     = logEvent.Exception != null?logEvent.Exception.ToString() : null,
                                               Data        = PropertiesToData(logEvent),
                                               Application = AppDomain.CurrentDomain.FriendlyName,
                                               Source      = logEvent.LoggerName,
                                               Hostname    = Environment.MachineName,
                                               Type        = Type(logEvent)
            };

            _logger.Log(message);
        }
示例#3
0
 public ElmahIoTarget(ILogger logger)
 {
     _logger = logger;
 }
示例#4
0
 public ElmahIoTarget(ILogger logger)
 {
     _logger = logger;
 }