Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public ElmahIoTarget(ILogger logger)
 {
     _logger = logger;
 }
Esempio n. 4
0
 public ElmahIoTarget(ILogger logger)
 {
     _logger = logger;
 }