通过NodeJ在Azure Linux App Service中捕获标准输出 [英] Capturing stdout in Azure Linux App Service via NodeJs
问题描述
我已将NodeJS应用程序部署到Linux App Service,该应用程序记录到stderr和stdout. Linux App Service中的诊断日志功能似乎无法正常工作,因为表存储中没有任何内容. Kudu中唯一的日志来自部署Docker容器的时间.之后,它什么也不记录.
I have deployed a NodeJS application to Linux App Service that logs to stderr and stdout. The diagnostic logs functionality in Linux App Service does not appear to work, as nothing appears in table storage. The only logs in Kudu are from when the docker container is deployed. After that, it logs nothing.
即使遵循有没有人想出一种捕获stdout和stderr的方法?还是可以推荐一个可以在Linux App Service平台上与NodeJS一起成功使用的库?
Has anyone come up with a way to capture stdout and stderr? or can recommend a library that they have gotten to work successfully with NodeJS on the Linux App Service platform?
推荐答案
您可以使用 Azure CLI 2.0 捕获标准输出.尝试使用以下命令.
You could use Azure CLI 2.0 to capture stdout. Try to use the following commands.
az webapp log config -g <resource group name> -n <app name> --application-logging true --detailed-error-messages true --level verbose
az webapp log tail -g <resource group name> -n <app name>
您可以获取有关-h
root@shui:~# az webapp log config -h
Command
az webapp log config: Configure web app logs.
Arguments
--application-logging : Configure application logging to file system. Allowed values: false,
true.
--detailed-error-messages: Configure detailed error messages. Allowed values: false, true.
--failed-request-tracing : Configure failed request tracing. Allowed values: false, true.
--level : Logging level. Allowed values: error, information, verbose, warning.
--slot -s : The name of the slot. Default to the productions slot if not
specified.
--web-server-logging : Configure Web server logging. Allowed values: filesystem, off,
storage.
有关Azure Cli支持linux webapp的更多信息,请参考此链接.
More information about Azure Cli supports linux webapp please refer to this link.
这篇关于通过NodeJ在Azure Linux App Service中捕获标准输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!