コード例 #1
0
        public static void UseTraceLogEntriesEnrichment(this ExceptionlessConfiguration config, int maxEntriesToInclude = TraceLogEnrichment.DefaultMaxEntriesToInclude)
        {
            if (!Trace.Listeners.OfType <ExceptionlessTraceListener>().Any())
            {
                Trace.Listeners.Add(new ExceptionlessTraceListener());
            }

            config.Settings.Add(TraceLogEnrichment.MaxEntriesToIncludeKey, maxEntriesToInclude.ToString());
            config.AddEnrichment <TraceLogEnrichment>();
        }
        public static void UseTraceLogEntriesEnrichment(this ExceptionlessConfiguration config, int?defaultMaxEntriesToInclude = null)
        {
            int maxEntriesToInclude = config.Settings.GetInt32(TraceLogEnrichment.MaxEntriesToIncludeKey, defaultMaxEntriesToInclude ?? 0);

            if (!Trace.Listeners.OfType <ExceptionlessTraceListener>().Any())
            {
                Trace.Listeners.Add(new ExceptionlessTraceListener(maxEntriesToInclude));
            }

            if (!config.Settings.ContainsKey(TraceLogEnrichment.MaxEntriesToIncludeKey) && defaultMaxEntriesToInclude.HasValue)
            {
                config.Settings.Add(TraceLogEnrichment.MaxEntriesToIncludeKey, maxEntriesToInclude.ToString());
            }

            config.AddEnrichment(typeof(TraceLogEnrichment).Name, c => new TraceLogEnrichment(c));
        }
コード例 #3
0
 /// <summary>
 /// Reads the Exceptionless configuration from the app.config or web.config file.
 /// </summary>
 /// <param name="config">The configuration object you want to apply the attribute settings to.</param>
 public static void UseErrorEnrichment(this ExceptionlessConfiguration config)
 {
     config.RemoveEnrichment <SimpleErrorEnrichment>();
     config.AddEnrichment <Enrichments.ErrorEnrichment>();
 }
コード例 #4
0
 /// <summary>
 /// Automatically set a reference id for error events.
 /// </summary>
 public static void UseReferenceIds(this ExceptionlessConfiguration config)
 {
     config.AddEnrichment <ReferenceIdEnrichment>();
 }
コード例 #5
0
 /// <summary>
 /// Reads the Exceptionless configuration from the app.config or web.config file.
 /// </summary>
 /// <param name="configuration">The configuration object you want to apply the attribute settings to.</param>
 public static void UseErrorEnrichment(this ExceptionlessConfiguration configuration)
 {
     configuration.RemoveEnrichment <Enrichments.Default.SimpleError>();
     configuration.AddEnrichment <Enrichments.ErrorEnrichment>();
 }