3

I have a Node application (Bot Framework bot) hosted on Azure. What's the best way to log information for debugging? For example, as far as i'm aware, using console.log() isn't helpful because there is no console to look at in Azure. I also do not want to call tons of session.send() to the client.

So whats the best way to get some sort of debug logging?

2 Answers 2

3

You can leverage the Diagnostic Log extension on Azure Web Apps. Login your web app in Azure portal(https://ms.portal.azure.com/). Click on Diagnostic logs in settings option and Turn On Application logging in Diagnostic Logs Tab. enter image description here

And then you can login the Kudu console site of your web app(https://<Your_Webapp_name>.scm.azurewebsites.net/DebugConsole) and browse to your Application folder(D:\home\LogFiles\Application folder). enter image description here

Otherwise, you can click the Diagnostic dump on the top nav bar of the kudu console site to download the log files. enter image description here

On the other hand, you can use the Log stream tool on the Azure portal(https://ms.portal.azure.com/) for a real time debugging online. enter image description here

At last, you can integrate a 3rd part node.js log modules, such like winston into your application. And catch the logs into your own log file.

Any further concern, please feel free to let me know.

Sign up to request clarification or add additional context in comments.

2 Comments

How to log the message ? I tried with console.log and nothing appears in the kudu portal. Also I changed the log level to verbose and added IISNode file but logs not appearing anywhere
1

This guide seems to answer your question: https://azure.microsoft.com/en-us/documentation/articles/web-sites-nodejs-debug. (If not, please provide additional info about what you'd like to achieve.)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.