How to get standard out from a Node.js application in Azure?

We have a Node.js application with a pretty big codebase that we're trying to deploy to an Azure Web Site. My problem is that when I deploy the app and try to access it, I just get a message saying "The page cannot be displayed because an internal server error has occurred".

According to http://azure.microsoft.com/en-us/documentation/articles/web-sites-nodejs-debug/ I should be able to configure some settings and have my standard out be logged to a file - well, it's not working. in /LogFiles I can see /git, /html, and /DetailedErrors, but none of these folders contain the stdout logs.

I have deployed the app using Visual Studio. I created a blank Azure project, and manually added all the folders and files I need. I also created an iisnode.yml file that contains the following config:

loggingEnabled: true
devErrorsEnabled: true
logDirectory: ./logs
debugHeaderEnabled: true

The last two lines I added later, the first ones are from the tutorial. I also have a web.config file, the contents of which I haven't really touched.

I've attempted to configure the settings that are available in the Web Sites UI, but I haven't really been able to make any headway. I think currently they are pretty much default.

I'm sorry that I can't provide you with more information. I'm really kind of banging my head against the wall here, since all the tutorials I've found basically state that if I do this and that, everything should work. The problem is, it doesn't. Sad face.

Edit: I should probably add that my server.js is in a folder called /NodeServer. It's not in the root as Azure seems to presume.

Edit2: I deployed a Hello World example and got it to work, but when I try to move the server.js file from the root I can't get it to work anymore.

I've added a tag to the web.config, so that the structure is basically

configuration
  location path="NodeServer"
   system.webServer

I've also edited my package.json so that it says

"main":"NodeServer/server.js",
"scripts":{
   "start":"cd NodeServer && node server.js"
}

If the app is started successfully, you should be able to find the stdout at

D:\home\LogFiles\Application

in Azure Websites, without configuring anything.

But here it looks like an error related to incorrect/missing web.config. The node app may not get launched. You can try:

  1. Publishing your app using git to Azure Websites.
  2. Or if you are familiar with IIS and iisnode, make sure your app works locally with IIS and iisnode. See http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
  3. Or try publishing an "hello world" node.js app to Azure Websites, take the generated web.config and modify it for your app.

Edit: When you change the location of server.js, you have to change web.config too. The change in web.config is not correct. And package.json is only used as hints to generate web.config during git deployment. To get your "hello world" to work, you can either

  1. In your web.config, replace all "server.js" with "NodeServer/server.js".
  2. Or deploy the modified app using git. Make sure it does not contain the wrong web.config.

Then you can try to get your larger app to work.