Asp.net Core Azure Web应用程序日志记录 [英] Asp.net Core azure web app logging
问题描述
我已经将asp.net核心部署为Azure,并且我正在尝试使用Microsoft.Extentions.Logging
接口将日志记录配置到我的应用程序中.
I have an asp.net core deployed to azure, and I am trying to configure logging to my application using the Microsoft.Extentions.Logging
interfaces.
当前我的应用程序正在将日志写入Web应用程序存储中的日志文件"文件夹.
currently my app is writing the logs to Log Files folder in the web app storage.
这似乎是记录我的更改的正确位置.但是,我想在普通界面中查看这些日志-每次下载文本文件都有点烦人.
This seems like the right place to log my changes. However, I want to view these logs in a normal interface - downloading a text file everytime, is kinda annoying.
我已经研究了应用程序见解和天蓝色的诊断日志,但是都没有建议如何使用ILogger界面使用它.
I have looked into application insights, and azure diagnostic logs, but none of them suggest how to work with it using the ILogger interface.
推荐答案
首先,您必须在Azure上的应用程序中配置日志:
First of all you have to configure logs in your application on Azure:
还有一个选项可以查看应用程序控制台的输出:
There is also an option to look at the application console output:
您还可以在Azure上配置存储并在此处保存日志(您可以在诊断日志部分中进行配置.
You can also configure Storage on Azure and save logs there (you can configure that in Diagnostic logs section).
这篇关于Asp.net Core Azure Web应用程序日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!