在 Azure 门户中跟踪 System.Diagnostics.Trace 日志

Eut*_*rpy 5 c# system.diagnostics azure azure-application-insights visual-studio-2017

在我的网络应用程序中,我使用

System.Diagnostics.Trace.WriteLine(...);
Run Code Online (Sandbox Code Playgroud)

用于诊断。应用程序发布到 Azure 部署槽。我想知道在 Azure 门户(或 Visual Studio 的云资源管理器)中哪里可以找到这些日志。

gbe*_*ann 7

您首先需要激活应用程序日志:

  1. 转到您的 Web 应用程序。
  2. 转到Monitoring/ App Service logs
  3. 启用Application Logging并配置它。

应用程序日志

这篇文章也很有用:https : //stackify.com/azure-app-service-log-files/