Exemple #1
0
        private void SendMessage(LogEntry logEntry)
        {
            ContextItems items = new ContextItems();

            items.ProcessContextItems(logEntry);
            LoggingSettings settings = loggingConfigurationView.GetLoggingSettings();
            LogDistributionStrategyFactory factory  = new LogDistributionStrategyFactory(this.loggingConfigurationView.ConfigurationContext);
            ILogDistributionStrategy       strategy = factory.CreateDistributionStrategy(settings.DistributionStrategy);

            strategy.SendLog(logEntry);
        }
        private void ProcessLog(LogEntry log)
        {
            ContextItems items = new ContextItems();

            items.ProcessContextItems(log);

            IEnumerable <LogSource> matchingTraceSources = GetMatchingTraceSources(log);
            TraceListenerFilter     traceListenerFilter  = new TraceListenerFilter();

            foreach (LogSource traceSource in matchingTraceSources)
            {
                try
                {
                    traceSource.TraceData(log.Severity, log.EventId, log, traceListenerFilter);
                }
                catch (Exception ex)
                {
                    ReportExceptionDuringTracing(ex, log, traceSource);
                }
            }
        }
        void ProcessLog(LogEntry log)
        {
            // revert any outstanding impersonation
            using (WindowsImpersonationContext revertImpersonationContext = RevertExistingImpersonation())
            {
                ContextItems items = new ContextItems();
                items.ProcessContextItems(log);

                IEnumerable <LogSource> matchingTraceSources = GetMatchingTraceSources(log);
                TraceListenerFilter     traceListenerFilter  = new TraceListenerFilter();

                foreach (LogSource traceSource in matchingTraceSources)
                {
                    try
                    {
                        traceSource.TraceData(log.Severity, log.EventId, log, traceListenerFilter);
                    }
                    catch (Exception ex)
                    {
                        ReportExceptionDuringTracing(ex, log, traceSource);
                    }
                }
            }
        }
Exemple #4
0
        private void ProcessLog(LogEntry log, TraceEventCache traceEventCache)
        {
            // revert any outstanding impersonation
            using (RevertExistingImpersonation())
            {
                var items = new ContextItems();
                items.ProcessContextItems(log);

                var matchingTraceSources = GetMatchingTraceSources(log);
                var traceListenerFilter  = new TraceListenerFilter();

                foreach (LogSource traceSource in matchingTraceSources)
                {
                    try
                    {
                        traceSource.TraceData(log.Severity, log.EventId, log, traceListenerFilter, traceEventCache);
                    }
                    catch (Exception ex)
                    {
                        ReportExceptionDuringTracing(ex, log, traceSource);
                    }
                }
            }
        }
Exemple #5
0
 private void SendMessage(LogEntry logEntry)
 {
     ContextItems items = new ContextItems();
     items.ProcessContextItems(logEntry);
     LoggingSettings settings = loggingConfigurationView.GetLoggingSettings();
     LogDistributionStrategyFactory factory = new LogDistributionStrategyFactory(this.loggingConfigurationView.ConfigurationContext);
     ILogDistributionStrategy strategy = factory.CreateDistributionStrategy(settings.DistributionStrategy);
     strategy.SendLog(logEntry);
 }