Skip to content

Commit

Permalink
code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
christiaanwesterbeek committed Jan 8, 2014
1 parent ab05c99 commit 9fee19f
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/express-loggly.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@ var config = require('../../../config'); // <!---- here now en nu naar Loggly..
var client = loggly.createClient(config.loggly);

//example by http://www.hacksparrow.com/how-to-write-midddleware-for-connect-express-js.html

/* Usage
//the sequence matters. It's the sequence middleware is executed
app.use(require('express-loggly').requestLogger()); //http://stackoverflow.com/questions/7263626/node-js-how-to-do-something-on-all-http-requests-in-express
app.use(app.router);
// the error handler is strategically placed *below* the app.router;
// if it were above it would not receive errors from app.get() etc
app.use(require('express-loggly').errorLogger()); //http://stackoverflow.com/questions/15684130/express-js-error-handling
Now we neede to know how to handle app generated errors.
*/
//info on sequence: http://runnable.com/UTlPPV-f2W1TAAEf/custom-error-pages-in-express-for-node-js
// http://expressjs.com/guide.html#error-handling
//some other middleware for logging:
// http://fabianosoriani.wordpress.com/2013/04/13/loggly-middleware-for-express-js-server-visibility/
//

var logger = function (err, req, res, next) {
console.log('express-loggly middleware function call....', err);
if (err) {
console.log('arguments', arguments)
}
//console.log(arguments);
next(err);
}
Expand Down

0 comments on commit 9fee19f

Please sign in to comment.