I cannot log with Morgan. It doesn't log info to console. The documentation doesn't tell how to use it.
I want to see what a variable is. This is a code from response.js
file of expressjs framework:
var logger = require("morgan");
res.render = function(view, options, fn){
options = options || {};
var self = this;
var req = this.req;
var app = req.app;
// support callback function as second arg
if ('function' == typeof options) {
fn = options, options = {};
}
// merge res.locals
options._locals = self.locals;
// default callback to respond
fn = fn || function(err, str){
if (err) return req.next(err);
self.send(str);
};
// Here I want to see what fn is
// But it doesn't show me anything in console
// How to use it?
logger(fn);
// render
app.render(view, options, fn);
};
How to use Morgan?
See Question&Answers more detail:os