I'm using Node Express and logging using Connect
Logger<http://www.senchalabs.org/connect/logger.html> which
I understand is now called Morgan <https://github.com/expressjs/morgan>.
Most tokens that I want to see, correctly log a value, but a number of them
are coming up as hyphens. For instance the default log format (defined in
the module source code) is:
default ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status
:res[content-length] ":referrer" ":user-agent"'
but the following two tokens only display a hyphen (instead of an actual
value):
:res[content-length]:referrer
I've also attempted to define new tokens following Connect's content-type
example:
express.logger.token('type', function(req, res){ return
req.headers['content-type']; })
but again no luck. I've also tried various header spellings and
capitalization. My end goal is to display the username making requests,
but I can't even get the out-of-the-box experience to work, so am wondering
if I have things configured correctly. My code setup / npm listing is at this
associated stackoverflow
question<https://stackoverflow.com/questions/22058157/express-connect-logger-missing-some-tokens>
.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.