Azure Logic Apps:如何在Log Analytics中查找输出错误消息?
Logic App 具体错误消息查询位置
1. 优先查 traces 表
traces表是Logic App详细日志的核心存储,大部分步骤级的错误消息都在这里。直接过滤错误级别的记录,就能提取具体内容:
traces | where severityLevel >= 3 // 3对应Error级别,4是Critical | where operation_Name contains "你的Logic App名称" | project timestamp, 步骤标识=operation_Name, 错误消息=message, 附加详情=customDimensions
customDimensions里还藏着步骤名称、错误代码、触发源这些细节,比如customDimensions['StepName']能直接定位到出错的具体步骤。
2. 用 requests 表关联追根溯源
如果已经通过requests表统计到失败请求,可以通过operation_Id关联traces表,把失败请求和对应错误消息绑定:
requests | where success == false | where operation_Name contains "你的Logic App名称" | join kind=inner traces on operation_Id | where traces.severityLevel >=3 | project 时间=requests.timestamp, 流程名称=requests.operation_Name, 错误详情=traces.message, 步骤信息=traces.customDimensions
3. FunctionAppLogs 表(涉及函数调用时)
如果Logic App里调用了Azure Functions,函数执行的错误会单独存在FunctionAppLogs里,直接过滤Error级别即可:
FunctionAppLogs | where Level == "Error" | project 时间=timestamp, 调用ID=InvocationId, 错误消息=Message, 附加属性=Properties
额外注意点
- 部分深层错误消息会嵌套在
customDimensions的ErrorDetails字段里,需要用parse_json解析:traces | where severityLevel >=3 | extend 错误详情=parse_json(customDimensions['ErrorDetails']) | project timestamp, message, 错误详情 - 一定要确认Logic App的诊断设置开了详细日志级别,不然可能抓不到完整的错误内容。
内容的提问来源于stack exchange,提问作者LStrike
相关产品推荐
相关产品推荐

