【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


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

相关推荐
余防17 小时前
app安全测试-服务端
安全·web app
暗冰ཏོ6 天前
2026 App 开发完整指南:Android、iOS、跨平台开发与安卓应用上线全流程
android·ios·uni-app·web app·app开发
AIFQuant7 天前
贵金属投资 APP 开发:实时报价、图表、提醒与交易数据全链路
开发语言·前端·websocket·金融·web app
万能小林子9 天前
如何将网页在线转APP?5种打包工具对比速成指南(含在线/手机/电脑方案)
android·ios·uni-app·web app·wap2app·app打包·app封装
编码者卢布10 天前
【Azure App Service】应用服务(Web App)里的 SNAT 端口 vs 出站连接数:到底是谁限制了谁?
flask·azure·web app
JCJC错别字检测-田春峰13 天前
字根秀秀 HTML 托管现已支持“用户登录”功能,一键变身 Web App!
前端·html·web app·网页托管
UXbot14 天前
企业AI开发工具:界面自动生成与前端代码交付能力详解
前端·人工智能·交互·web app·ui设计
万能小林子21 天前
2026 AI开发新范式:Vibe Coding生成网页 + 3分钟打包成App,非技术人也能独立发布自己的App!
人工智能·uni-app·ai编程·web app·vibecoding