我正在尝试在azure中启用应用程序日志.
我在azure的appService中运行了一个虚拟Net Core 2应用程序.
基本上我的目标是在日志流和应用程序日志文件中查看跟踪消息,但我没有找到正确的方法来执行此操作.
我发现阅读其他帖子的挑战之一是他们假设有一个Web配置.
解决方法:
你可以从这个blog得到答案.以下是博客的片段.
Setting up logging in an ASP.NET Core app doesn’t require much code. ASP.NET Core new project templates already setup some basic logging providers with this code in the Startup.Configure method:
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();