具有Azure函数的Application Insights跟踪侦听器 [英] Application Insights Trace Listener with azure functions

查看:69
本文介绍了具有Azure函数的Application Insights跟踪侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆服务,这些服务发出System.Diagnostics.Trace.*跟踪消息,并且通过webapi托管时,我只包含了Microsoft.ApplicationInsights.TraceListener程序包,并且我的跟踪收集在应用程序见解中.但是,部分设置需要一个web.config文件来告知跟踪侦听器进行侦听和刷新,例如:

I have a bunch of services which emit System.Diagnostics.Trace.* trace messages and when hosted via webapi, I simply include the Microsoft.ApplicationInsights.TraceListener package and my traces are collected in app insights. However, part of the setup requires a web.config file to tell the trace listener to listen and flush like:

<system.diagnostics>
  <sources>
    <source name="TraceLogging" switchName="Verbose">
      <listeners>
        <add name="appinsights" type="Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener, Microsoft.ApplicationInsights.TraceListener"/>
      </listeners>
    </source>
  </sources>

此答案看来,我似乎无法通过web.confg.

From this answer it doesn't seem like I can setup this up via web.confg.

有什么方法可以使跟踪侦听器向我的应用程序见解发送跟踪吗?

Is there any way to enable the trace listener to send traces to my app insights?

推荐答案

有计划公开配置和日志记录提供程序的可扩展性,这些扩展性将启用这种情况,但是当前不支持.

There are plans to expose configuration and logging providers extensibility that would enable scenarios like this, but this is not currently supported.

这篇关于具有Azure函数的Application Insights跟踪侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆