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
To enable application logging for Windows apps in the Azure portal, navigate to your app and select App Service logs. Select On for either Application Logging (Filesystem) or Application Logging (Blob), or both.
That's pretty much it. Now you can simply visit your application using the URL you can see on your Azure dashboard. On the portal, click on “Log Stream” immediately below “App Services log” and you'll see the log messages in real time.
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
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