Log4Net with Application Insights

后端 未结 4 1659
Happy的楠姐
Happy的楠姐 2020-12-29 03:59

I am trying to configure my azure asp.net website to send log4net traces to Azure Application Insights. I can see in my azure console page views etc, hence I know that is wo

4条回答
  •  天命终不由人
    2020-12-29 04:35

    Your log4net configuration is correct; I have used it in a test web site and it worked. Also, since you're seeing other AI data in Fiddler, your AI is also configured properly. One thing to look for in such cases is the log4net.Config.XmlConfigurator attribute. It's an assembly-level attribute and it might be necessary for log4net configuration to be read properly.

    [assembly: log4net.Config.XmlConfigurator(Watch = true)]
    

    Can you please make sure you have it specified in your project and try again?

提交回复
热议问题