protected override void Append(LoggingEvent loggingEvent) { if (string.IsNullOrEmpty(ApiKey)) return; List<string> tags = (Tags ?? "").Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries).ToList(); tags = tags.Concat(EnvironmentalTags).OrderBy(x => x).Distinct().ToList(); string text = RenderLoggingEvent(loggingEvent); string title = BuildTitle(loggingEvent, text); string priority = (loggingEvent.Level >= Level.Error) ? "normal" : "low"; string alertType = GetAlertType(loggingEvent); string aggregateKey = new AggregationKeyCalculator().Calculate(title, loggingEvent.LoggerName); var datadogEvent = new DatadogEvent { Tags = tags, AlertyType = alertType, Priority = priority, Text = text, Title = title, AggregationKey = aggregateKey }; PostEvent(datadogEvent).Wait(); }
protected override void Append(LoggingEvent loggingEvent) { if (string.IsNullOrEmpty(ApiKey)) { return; } List <string> tags = (Tags ?? "").Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(); tags = tags.Concat(EnvironmentalTags).OrderBy(x => x).Distinct().ToList(); string text = RenderLoggingEvent(loggingEvent); string title = BuildTitle(loggingEvent, text); string priority = (loggingEvent.Level >= Level.Error) ? "normal" : "low"; string alertType = GetAlertType(loggingEvent); string aggregateKey = new AggregationKeyCalculator().Calculate(title, loggingEvent.LoggerName); var datadogEvent = new DatadogEvent { Tags = tags, AlertyType = alertType, Priority = priority, Text = text, Title = title, AggregationKey = aggregateKey }; PostEvent(datadogEvent).Wait(); }