Can Application Insights log to a local file in the application directory? We have an implementation where each customer who uses our software needs to have a separate instance of Application Insights. Our client software relies on a call to a web service to get the Instrumentation Key. We are running into some issues where we need logging before we get the Instrumentation key.
Can Application Insights log to the local file system? Or can it cache logs such that they can be explored? Thanks.
You can write own channel for this purpose. Implement ITelemetryChannel
and use its Send method to write telemetry to local disk.
class FileChannel : ITelemetryChannel
{
public MyChannel()
{
}
public bool? DeveloperMode { get; set; }
public string EndpointAddress { get; set; }
public void Dispose()
{
}
public void Flush()
{
}
public void Send(ITelemetry item)
{
// logic to write item to file..
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With