Anup Das Gupta
Anup Das Gupta

Reputation: 771

Azure application logging(blob) for node.js deployed as app service

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

Upvotes: 7

Views: 1868

Answers (1)

Xavier
Xavier

Reputation: 151

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

Upvotes: 3

Related Questions