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
Seems you too are confused with the same thing as I was, the reason I stumbled upon this question. I think we associate logging with manual logging as we would do in Java with log4j (if you know java) where we instantiate a Logger and say log 'this'.
Then I dug in morgan code, turns out it is not that type of a logger, it is for automated logging of requests, responses and related data. When added as a middleware to an express/connect app, by default it should log statements to stdout showing details of: remote ip, request method, http version, response status, user agent etc. It allows you to modify the log using tokens or add color to them by defining 'dev' or even logging out to an output stream, like a file.
For the purpose we thought we can use it, as in this case, we still have to use:
console.log(..);
Or if you want to make the output pretty for objects:
var util = require("util");
console.log(util.inspect(..));