【应用服务 App Service】App Service发生错误请求时,如何查看IIS Freb日志,从中得知错误所发生的模块,请求中所携带的Header信息

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介: 【应用服务 App Service】App Service发生错误请求时,如何查看IIS Freb日志,从中得知错误所发生的模块,请求中所携带的Header信息

问题描述

在使用Azure App Service时候,我们有时候对 一些请求发生错误毫无头绪,能从错误代码中知道请求错误,但是更多的信息呢? 当我们需要更多的信息时候,通常有以下的一些方式来查找问题:

  • 在浏览器中开启开发者模式(F12),查看Network的记录,分析那些请求错误,找出请求Header及Response...
  • 使用Fiddler抓取本机发出的请求记录...
  • 在代码中添加更多的业务日志,查看代码运行到哪一行才出现错误...
  • 使用Postman发送请求,验证是否时请求的Header或Body不匹配...

但是,Azure App Service作为PaaS服务(平台即服务),提供了非常有帮助的错误请求日志 - FREB日志。 以下的内容就介绍如何开启Freb日志如何查看日志,及在日志中能发现有用的信息

开启FREB日志

进入App Service的App Service logs页面,开启Failed request tracing。

Failed Request Tracking

Detailed information on failed requests including the web server components which were used to process the request and time that was taken to process the request.

Detailed Error Messages

If the error code is greater than 400, the app service can store the HTML pages which otherwise would have been sent to the client. These pages can be useful to identify / troubleshoot the error.

查看FREB日志

一:登录Kudu站点 (App Service --> Advanced Tools 页面 --> GO 或者在app Service的URL中添加.scm,如:https://xxxxxxxxxxxx.scm.chinacloudsites.cn)

二:进入D:\home\LogFiles\W3SVC开头的目录,选中如错误请求时间点匹配的文件,点击右边的“下载按钮”,FREB日志显示为可阅读格式。

:如需要拷贝出去,当需要友好的阅读体验时,也需要在同一目录文件中包含freb.xml文件)

 

从FREB中分析内容

查看Request在IIS中最终所到达时候的Header信息,是否有缺少默写敏感的信息,如Authorization。

查看Request的所经历的Module及错误代码

相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
相关文章
|
20天前
|
应用服务中间件 Linux 网络安全
【Azure 应用服务】App Service for Linux 环境中为Tomcat页面修改默认的Azure 404页面
【Azure 应用服务】App Service for Linux 环境中为Tomcat页面修改默认的Azure 404页面
|
20天前
|
API C#
【Azure App Service】验证App Service接受HTTP 2.0请求
【Azure App Service】验证App Service接受HTTP 2.0请求
|
20天前
|
API 持续交付 数据安全/隐私保护
【Azure ACR+App Service】ACR WebHook请求App Service时遇见 401 Unauthorized
【Azure ACR+App Service】ACR WebHook请求App Service时遇见 401 Unauthorized
|
20天前
|
Docker 容器
【Azure 应用服务】App Service for Container 无法拉取Docker Hub中的镜像替代方案
【Azure 应用服务】App Service for Container 无法拉取Docker Hub中的镜像替代方案
|
20天前
|
API C++
【Azure 应用服务】Azure Function App在部署时候遇见 503 ServiceUnavailable
【Azure 应用服务】Azure Function App在部署时候遇见 503 ServiceUnavailable
|
3月前
|
网络协议
windows_server2012搭建iis并配置http重定向 iis转发
windows_server2012搭建iis并配置http重定向 iis转发
154 1
|
21天前
|
开发框架 .NET 中间件
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
|
23天前
|
C++
【Azure云服务 Cloud Service】如何在部署云服务Cloud Service时候通过启动任务Start Task来配置IIS (如开启ARR)
【Azure云服务 Cloud Service】如何在部署云服务Cloud Service时候通过启动任务Start Task来配置IIS (如开启ARR)
|
3月前
|
Windows
iis配置http重定向302转发get请求并去掉最后的斜杠/ iis重定向 iis去除url最后的斜杠 iis重定向链接斜杠(已解决)
iis配置http重定向302转发get请求并去掉最后的斜杠/ iis重定向 iis去除url最后的斜杠 iis重定向链接斜杠(已解决)
82 0
|
4月前
|
JavaScript Windows
VUE部署到IIS中报404错误解决方案-配置URL重写
VUE部署到IIS中报404错误解决方案-配置URL重写
199 0