1
votes

I have deployed a NodeJS application to Linux App Service that logs to stderr and stdout. The diagnostic logs functionality in Linux App Service does not appear to work, as nothing appears in table storage. The only logs in Kudu are from when the docker container is deployed. After that, it logs nothing.

The SSH component in Kudu does not work, even after following the official setup documentation.

Has anyone come up with a way to capture stdout and stderr? or can recommend a library that they have gotten to work successfully with NodeJS on the Linux App Service platform?

1
Are you running an app from a custom container? We are still working on properly hooking up diagnostic logging, especially for table storage, but much of that stuff doesn't fully apply if you're running a custom container because we don't exert any control over what you're executing inside your container. I suggest redirecting your stdout and stderr to .log files in /home/LogFiles - we almost have the log streaming feature fully working for Linux apps, and once it's in place, you can connect to it and see real-time messages from log files in that folder. - nlawalker
@Baldy nlawalker is the Microsoft developer, the function that you need will reach in the future. - Shui shengbao
Ok thanks for clarification - Baldy

1 Answers

3
votes

You could use Azure CLI 2.0 to capture stdout. Try to use the following commands.

az webapp  log config -g <resource group name> -n <app name> --application-logging true --detailed-error-messages true --level verbose
az webapp  log tail -g <resource group name> -n <app name>

You could get help with -h

root@shui:~# az webapp log config -h

Command
    az webapp log config: Configure web app logs.

Arguments
    --application-logging    : Configure application logging to file system.  Allowed values: false,
                               true.
    --detailed-error-messages: Configure detailed error messages.  Allowed values: false, true.
    --failed-request-tracing : Configure failed request tracing.  Allowed values: false, true.
    --level                  : Logging level.  Allowed values: error, information, verbose, warning.
    --slot -s                : The name of the slot. Default to the productions slot if not
                               specified.
    --web-server-logging     : Configure Web server logging.  Allowed values: filesystem, off,
                               storage.

More information about Azure Cli supports linux webapp please refer to this link.