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.
答案 0 :(得分:0)
您可以为此编写自己的频道。实现ITelemetryChannel
并使用其Send方法将遥测写入本地磁盘。
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..
}
}