private void BuildTraceListeners(FormatterCollectionNode formatters)
		{
			TraceListenerCollectionNodeBuilder builder = new TraceListenerCollectionNodeBuilder(ServiceProvider, settings.TraceListeners, formatters);
			TraceListenerCollectionNode listeners = builder.Build();
			BuildCategoryTraceSources(listeners);
			BuildSpecialTraceSources(listeners);
			node.AddNode(listeners);
		}
        /// <summary>
        /// Adds the <see cref="LoggingSettingsNode"/> and adds the default nodes.
        /// </summary>
        /// <param name="node">The <see cref="LoggingSettingsNode"/> added.</param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            base.ExecuteCore(node);
			LoggingSettingsNode loggingNode = ChildNode as LoggingSettingsNode;
			if (loggingNode == null) return;

            TextFormatterNode defaultTextFormatterNode = new TextFormatterNode();
            FormattedEventLogTraceListenerNode defaultTraceListenerNode = new FormattedEventLogTraceListenerNode();
            CategoryTraceSourceNode generalCategoryNode = new CategoryTraceSourceNode(new TraceSourceData(Resources.TraceSourceCategoryGeneral, SourceLevels.All));

			loggingNode.AddNode(new LogFilterCollectionNode());

			CategoryTraceSourceCollectionNode categoryTraceSourcesNode = new CategoryTraceSourceCollectionNode();
			TraceListenerReferenceNode generalCategoryListenerRef = new TraceListenerReferenceNode(new TraceListenerReferenceData(defaultTraceListenerNode.Name));
			categoryTraceSourcesNode.AddNode(generalCategoryNode);
			generalCategoryNode.AddNode(generalCategoryListenerRef);
			generalCategoryListenerRef.ReferencedTraceListener = defaultTraceListenerNode;
			loggingNode.AddNode(categoryTraceSourcesNode);			
			
			SpecialTraceSourcesNode specialTraceSourcesNode = new SpecialTraceSourcesNode();			
			ErrorsTraceSourceNode errorsTraceSourcesNode = new ErrorsTraceSourceNode(new TraceSourceData());
            TraceListenerReferenceNode errorsTraceListenerReferenceNode = new TraceListenerReferenceNode();
			errorsTraceSourcesNode.AddNode(errorsTraceListenerReferenceNode);
			errorsTraceListenerReferenceNode.ReferencedTraceListener = defaultTraceListenerNode;
			specialTraceSourcesNode.AddNode(errorsTraceSourcesNode);
			specialTraceSourcesNode.AddNode(new NotProcessedTraceSourceNode(new TraceSourceData()));
			specialTraceSourcesNode.AddNode(new AllTraceSourceNode(new TraceSourceData()));
			loggingNode.AddNode(specialTraceSourcesNode);

			TraceListenerCollectionNode traceListenerCollectionNode = new TraceListenerCollectionNode();
			traceListenerCollectionNode.AddNode(defaultTraceListenerNode);
			defaultTraceListenerNode.Formatter = defaultTextFormatterNode;
			loggingNode.AddNode(traceListenerCollectionNode);

			FormatterCollectionNode formattersNode = new FormatterCollectionNode();
			formattersNode.AddNode(defaultTextFormatterNode);
			loggingNode.AddNode(formattersNode);


            loggingNode.DefaultCategory = generalCategoryNode;
            loggingNode.LogWarningWhenNoCategoriesMatch = true;
			loggingNode.TracingEnabled = true;

            ServiceHelper.GetUIService(serviceProvider).RefreshPropertyGrid();
        }
 public FormatterCollectionNode Build()
 {
     node = new FormatterCollectionNode();
     formatters.ForEach(new Action<FormatterData>(CreateFormatterNode));
     return node;
 }
		public TraceListenerCollectionNodeBuilder(IServiceProvider serviceProvider, TraceListenerDataCollection listeners, FormatterCollectionNode formatters)
			: base(serviceProvider)
		{
			this.listeners = listeners;
			this.formatters = formatters;
		}