3

I have a nodejs app which is nothing but a BOT built using Microsoft's bot builder framework. I created an azure app service to host this app. I would like to find a way to persist all the application logs and web server logs as well (if possible) to some persistent store. Just like native web applications where we can look up logs on a app server & debug the application issues.

After doing some research I found official document from microsoft on this but looks like it has following limitations.

  • We can't use file storage option of app service as it's good for 12 hours only so logs will not be saved forever.
  • Currently only .NET application logs can be written to the blob storage. Java, PHP, Node.js, Python application logs can only be stored on the file system (without code modifications to write logs to external storage).

I would like to check if anyone has tried any different approach for nodejs app. If yes then please share.

Thank you.

vijay
  • 109
  • 11

1 Answers1

3

So I would respond by saying that this is not really a Bot specific problem... meaning you would have the same problem if you were writing a vanilla Web API and wanted to have persistent logs. You need to pick on a logging technology that let's you log to a more persistent store than just the file system.

Since you're using Node you might want to look at leveraging the Winston logging framework which has an abstraction for various transports to be plugged in. Then you would plug in the Azure Storage Blob Transport when running in production and that will ensure that your logs are written out to Azure Storage.

Still, you'd have to go collect those from Azure Storage and aggregate them yourself which can be painful. If you really want real-time a distributed tracing system though, you might want to look into using Application Insights instead. There's even a Winston transport for that as well if you want to stay abstracted from using AI directly and just use it as another log stream.

Drew Marsh
  • 33,111
  • 3
  • 82
  • 100
  • 1
    Thank you. I will go over those options you provided and see which is the best fit for us. – vijay Jan 04 '19 at 20:00
  • @vijay, what are the option that you go for? – junnyea Sep 10 '20 at 07:09
  • Azure Storage is in preview, not ready for production scenarios [link](https://learn.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?pivots=container-linux) – asd123ea Oct 14 '20 at 18:17