ILoggingConfigurationCustomCategoryStart ILoggingConfigurationContd.LogToCategoryNamed(string categoryName)
            {
                if (string.IsNullOrEmpty(categoryName))
                    throw new ArgumentException(CommonResources.ExceptionStringNullOrEmpty, "categoryName");

                currentTraceSource = new TraceSourceData()
                {
                    Name = categoryName
                };

                loggingSettings.TraceSources.Add(currentTraceSource);
                return this;
            }
Ejemplo n.º 2
0
 private static TypeRegistration CreateLogSourceRegistration(TraceSourceData traceSourceData, string name)
 {
     var registration = traceSourceData.GetRegistrations();
     registration.Name = name;
     return registration;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of <see cref="SpecialTraceSourcesData"/>.
 /// </summary>
 /// <param name="mandatory">The configuration for the optional trace source to send all messages received.</param>
 /// <param name="notProcessed">The configuration for the optional to send messages with unknown categories.</param>
 /// <param name="errors">The configuration for the mandatory trace source to log processing errors.</param>
 public SpecialTraceSourcesData(TraceSourceData mandatory, TraceSourceData notProcessed, TraceSourceData errors)
 {
     this.AllEventsTraceSource = mandatory;
     this.NotProcessedTraceSource = notProcessed;
     this.ErrorsTraceSource = errors;
 }