using Microsoft.ApplicationInsights.Channel; namespace Core.Telemetry { public class DebugTelemetryChannel : InMemoryChannel, ITelemetryChannel { private readonly string _filePath; public ITelemetryChannel _defaultChannel; public DebugTelemetryChannel(string filePath) { _filePath = filePath; } public new void Send(ITelemetry item) { base.Send(item); var logEntry = $"{DateTime.UtcNow:u}|{item.Context.Operation.Name}|{item.Context.Operation.Id}"; //File.AppendAllText(_filePath, logEntry + Environment.NewLine); } } }