Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
251 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

1) Create file iisnode.yml in your root folder (D:homesitewwwroot) if not exists.

2) Add the following lines to it.

loggingEnabled: true
logDirectory: iisnode

After that done, you can find logs in D:homesitewwwrootiisnode.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...