How to enable BLOB-logging for a Node.js Api App on Azure?

会有一股神秘感。 提交于 2019-11-26 14:56:56

问题


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

Where are my logs, that I printed to stdout?


回答1:


1) Create file iisnode.yml in your root folder (D:\home\site\wwwroot) if not exists.

2) Add the following lines to it.

loggingEnabled: true
logDirectory: iisnode

After that done, you can find logs in D:\home\site\wwwroot\iisnode.

For more info, please refer to https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-nodejs-debug#enable-logging.




回答2:


After above settings in iisnode.yml, the logs you see D:\home\site\wwwroot\iisnode are from BLOB storage or file system.



来源:https://stackoverflow.com/questions/44029083/how-to-enable-blob-logging-for-a-node-js-api-app-on-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!