code: function logger (req, res, next) {
      var now = new Date();
  
      function logRequest()
      {
          var ok = 200 <= res.statusCode && res.statusCode <= 400;
          if (ok && config.methods.indexOf(req.method) < 0)
              return;
              
          var audit = {
              who: config.user(req),
              when: now.toISOString(),
              where: {
                  client: req.ip || req._remoteAddress || (req.connection ? req.connection.remoteAddress : undefined),
                  host: req.headers.host,
                  server: config.hostname
  			},
              why: req.method,
              what: (req.method == 'POST') ? res._headers['location'] : req.url,
              status: res.statusCode,
          };
          sally.log(audit);
      }
      
      onFinished(res, logRequest);
      next();
  }
docs: Generates audit record for every request that creates/modifies a resource.