Adds a DebugChannel for TelemetryClient
This commit is contained in:
parent
cdd645bb3b
commit
b2c0919a8c
8 changed files with 203 additions and 47 deletions
21
Core/Telemetry/DebugTelemetryChannel.cs
Normal file
21
Core/Telemetry/DebugTelemetryChannel.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue