Node.js applications hosted in IIS capture stdout and stderr (console.log) and make the output available over HTTP.
code
var http = require('http');
http.createServer(function (req, res) {
console.log('A new request arrived with HTTP headers: ' + JSON.stringify(req.headers));
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end('Hello, world! [logging sample]');
}).listen(process.env.PORT);
console.log('Application has started at location ' + process.env.PORT);
web.config
<configuration>
<system.webServer>
<!-- indicates that the hello.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="hello.js" verb="*" modules="iisnode" />
</handlers>
</system.webServer>
</configuration>