PlanTempusApp/Core/Telemetry/DebugTelemetryChannel.cs

22 lines
649 B
C#
Raw Normal View History

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);
}
}
}