public void Send(LogEventInfo logEvent)
        {
            if (logsTransport == null || logsTransport.Connected == false)
            {
                return;
            }
            bool shouldLog       = false;
            bool watchStackTrace = false;

            using (slim.EnterReadLock())
            {
                foreach (var config in logConfig)
                {
                    if (logEvent.LoggerName.StartsWith(config.Key) == false)
                    {
                        continue;
                    }
                    if (logEvent.Level < config.Value.Level)
                    {
                        continue;
                    }
                    shouldLog       = true;
                    watchStackTrace = config.Value.WatchStack;
                }
            }
            if (shouldLog == false)
            {
                return;
            }
            if (watchStackTrace)
            {
                logEvent.StackTrace = new StackTrace();
            }
            logsTransport.SendAsync(logEvent);
        }
예제 #2
0
        private void Enqueue(object msg)
        {
            if (eventsTransport == null || eventsTransport.Connected == false)
            {
                return;
            }

            eventsTransport.SendAsync(msg);
        }
예제 #3
0
 public void Send(LogEventInfo logEvent)
 {
     if (logsTransport == null || logsTransport.Connected == false)
     {
         return;
     }
     if (ShouldLog(logEvent))
     {
         logsTransport.SendAsync(logEvent);
     }
 }