如何为 Azure 上的 Node.js Api 应用程序启用 BLOB 日志记录? [英] How to enable BLOB-logging for a Node.js Api App on Azure?
问题描述
我在 azure 上有一个 node.js api 应用程序.我使用 bunyan
将每个请求记录到 sdtout
.如何保存和读取日志文件?我启用了 BLOB 日志记录.我的存储中唯一显示的是一堆 csv 文件.下面是一个例子:
I have a node.js api app on azure. I use bunyan
to log every request to sdtout
. How can I save and read the log files? I enabled BLOB-logging. The only thing that shows up in my storage is a bunch of csv-files. Here is an example:
| date | level | applicationName | instanceId | eventId | pid | tid | message
_______________________________________________________________________________________________________________________________________________________________
| 2017-05-17T14:21:15 | Verbose | myApp | tae9d6 | 636306276755847146 | 13192 | -1 | SnapshotHelper::RestoreSnapshotInternal SUCCESS - File.Copy
| 2017-05-17T14:21:15 | Verbose | myApp | tae9d6 | 636306276756784690 | 13192 | -1 | SnapshotHelper::RestoreSnapshotInternal SUCCESS - process
我打印到 stdout
的日志在哪里?
Where are my logs, that I printed to stdout
?
推荐答案
1) 在您的根文件夹 (D:homesitewwwroot
) 中创建文件 iisnode.yml
>) 如果不存在.
1) Create file iisnode.yml
in your root folder (D:homesitewwwroot
) if not exists.
2) 向其中添加以下几行.
2) Add the following lines to it.
loggingEnabled: true
logDirectory: iisnode
完成后,您可以在D:homesitewwwrootiisnode
中找到日志.
After that done, you can find logs in D:homesitewwwrootiisnode
.
有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-nodejs-debug#enable-logging.
For more info, please refer to https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-nodejs-debug#enable-logging.
这篇关于如何为 Azure 上的 Node.js Api 应用程序启用 BLOB 日志记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!