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?
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.

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).

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

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.

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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With