7

I have deployed a node application as azure app service. And enabled azure Application Logging(blob) with log level "Verbose" and linked a storage account of type blob. But my node.js console.log and console.error do not appear in the blob. I still keep on getting stdout and stderr file in file system logging.

My iisnode.yml file has the following content-

nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\6.3.0\node.exe"
nodeProcessCountPerApplication: 2
loggingEnabled: true
logDirectory: iisnode
maxLogFiles: 100
devErrorsEnabled: true
configOverrides: "iisnode.yml"
asyncCompletionThreadCount: 20
flushResponse: true

2
  • Very upsetting that this is not supported. Had the same issue and now I'm already second guessing whether nodejs is a first class citizen on the azure stack. Application logging to the file system automatically turns itself off after 12 hrs so you have to use an adapter like winston which seems counter productive. Commented Apr 17, 2017 at 4:09
  • Just a note, logging to Azure blobs can cost a non-negligible amount. If your application writes to logs once per second, the write operations alone will cost you 16 USD per month. Commented May 11, 2018 at 6:44

1 Answer 1

3

I'm trying to do the exact same thing right now and came across this:

For node.js websites the way to write application logs is by writing to the console using console.log('message') and console.error('message') which goes to Information/Error level log entries. Currently the only supported target for the log files for node.js is the file system.

It looks as though you can't use blob storage for application logs in Azure Web Apps. There are however Azure blob storage adapters for popular nodejs loggers such as winston: winston-azure-blob-transport

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

1 Comment

winston-azure-blob-transport works well. My current solution is to override console.log/error, calling the original method as well as logging to blob storage with winston.

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.