【App Service】kudu中日志文件夹(LogFiles)中的没有application日志的根本原因?

问题描述

在 Azure App Service 中运行 Web App 时,通过 Kudu(https://xxxxxxxxxx.scm.chinacloudsites.cn/ )访问文件系统,发现:

  • /home/LogFiles 或 D:\home\LogFiles 下没有预期日志
  • 特别是 application 目录(Application Log)未生成任何日志文件
  • 应用已正常运行,但 Kudu 中无法查看应用日志

问题解答

在 Azure App Service 中,应用日志(Application Logging)默认是关闭的。

如果没有在App Service中显式开启"Application Logging (Filesystem)"功能,即使应用内部使用了日志框架(例如 ILogger、Log4j、console.log 等)输出日志,这些日志也不会自动落盘到 /home/LogFiles/Application 或 D:\home\LogFiles\Application 路径中。

因此,在 Kudu 中查看不到日志并不代表应用没有生成日志,而是这些日志没有被写入文件中。

当开启日志后,就可以在Kudu的Logfiles中查看到Application的日志文件,但是Filesystem 类型的日志本身具有临时性,它通常用于调试场景,会自动在12小时后关闭。

Enable application logging to collect diagnostic traces from your web app code. You'll need to turn this on to enable the streaming log feature. This setting turns itself off after 12 hours.

参考资料

App Service 日志配置文档:https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs


当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

相关推荐
UXbot14 天前
帮助企业低门槛开展AI应用开发的平台推荐
前端·低代码·ui·交互·产品经理·原型模式·web app
UXbot14 天前
如何选择适合公司项目的UI设计工具?企业选型指南
前端·低代码·ui·团队开发·原型模式·设计规范·web app
UXbot15 天前
原型设计工具如何帮助新人快速进入产品行业?
前端·低代码·ui·交互·团队开发·原型模式·web app
UXbot20 天前
AI网页开发工具能替代工具吗?5大平台对比
前端·人工智能·低代码·ui·原型模式·web app
余防21 天前
app安全测试-服务端
安全·web app
暗冰ཏོ1 个月前
2026 App 开发完整指南:Android、iOS、跨平台开发与安卓应用上线全流程
android·ios·uni-app·web app·app开发
AIFQuant1 个月前
贵金属投资 APP 开发:实时报价、图表、提醒与交易数据全链路
开发语言·前端·websocket·金融·web app
万能小林子1 个月前
如何将网页在线转APP?5种打包工具对比速成指南(含在线/手机/电脑方案)
android·ios·uni-app·web app·wap2app·app打包·app封装
编码者卢布1 个月前
【Azure App Service】应用服务(Web App)里的 SNAT 端口 vs 出站连接数:到底是谁限制了谁?
flask·azure·web app
JCJC错别字检测-田春峰1 个月前
字根秀秀 HTML 托管现已支持“用户登录”功能,一键变身 Web App!
前端·html·web app·网页托管