gpt4 book ai didi

javascript - 如何从 Azure Functions JavaScript 函数中获取更详细的错误消息?

转载 作者:行者123 更新时间:2023-11-29 20:54:38 25 4
gpt4 key购买 nike

我在运行时 v2 上的 Azure Functions 上运行 Node.js 函数,运行该函数时经常会出错。但是调试错误真的很困难,因为大多数时候我唯一得到的是这样的:

2018-04-19T18:08:51  Welcome, you are now connected to log-streaming service.
2018-04-19T18:09:37.473 [Information] Executing 'Functions.GetAnswer' (Reason='This function was programmatically called via the host APIs.', Id=82d8e1df-7bb8-4f08-80c9-1d27d68959e2)
2018-04-19T18:09:37.788 [Error] System.Private.CoreLib: Exception while executing function: Functions.GetAnswer. System.Private.CoreLib: One or more errors occurred. (Worker process with pid 4736 exited with code 1) (Worker process with pid 5328 exited with code 1) (Worker process with pid 5428 exited with code 1). Worker process with pid 4736 exited with code 1.
2018-04-19T18:09:37.937 [Error] Executed 'Functions.GetAnswer' (Failed, Id=82d8e1df-7bb8-4f08-80c9-1d27d68959e2)

使用 App Insights 时,我没有获得更多信息:

Exception while executing function:
Functions.GetAnswer One or more errors occurred.
(Worker process with pid 4736 exited with code 1)
(Worker process with pid 5328 exited with code 1)
(Worker process with pid 5428 exited with code 1)
Worker process with pid 4736 exited with code 1
Worker process with pid 5328 exited with code 1
Worker process with pid 5428 exited with code 1

有没有办法得到一条错误消息来显示更多关于正在发生的事情?甚至可能是 Node.js 错误?

最佳答案

您可以尝试在您的 host.json 中将所有日志记录级别设置为 verbose:

{
"tracing": {
"consoleLevel": "verbose"
},
"logger": {
"categoryFilter": {
"defaultLevel": "verbose",
"categoryLevels": {
"Host.Results": "verbose",
"Function": "verbose",
"Host.Aggregator": "verbose"
}
}
}
}

然后检查它是否为您提供更多信息,但这个特定错误与 Azure Functions 运行时的内部部分相关,如果您不提供函数代码,将很难调查。

关于javascript - 如何从 Azure Functions JavaScript 函数中获取更详细的错误消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49927759/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com