Node.js applications hosted in IIS capture stdout and stderr (console.log) and make the output available over HTTP.

  1. output from console.log (or any stdout or stderr output) from a node.js application is captured, stored in a file on disk, and available through HTTP
  2. By default, given a node.js application at http://localhost/node/logging/hello.js, the logs are available at http://localhost/node/logging/iisnode/.
  3. Check the configuration sample to customize the logging behavior.
visit the node.js endpoint at hello.js
visit the logs at logs (only available after you first visit the endpoint)
debug node.js endpoint at hello.js/debug (requires WebKit enabled browser)


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]');

console.log('Application has started at location ' + process.env.PORT);



    <!-- indicates that the hello.js file is a node.js application 
    to be handled by the iisnode module -->

      <add name="iisnode" path="hello.js" verb="*" modules="iisnode" />