June 2013
Intermediate to advanced
236 pages
4h 33m
English
Express comes with a built-in logging module called logger, it can be a very useful tool while you are developing the app. You enable it like any other Express module:
app.use(express.logger());
Without any options, the logger middleware will log a detailed log. You can customize the details with the following tokens in the
format option of the logger middleware:
|
Token |
Content |
|---|---|
|
|
The specific HTTP header of the request |
|
|
The specific HTTP header of the response |
|
|
The HTTP version |
|
|
How long it took to generate the response |
|
|
The user agent's IP address |
|
|
Date and time of request |
|
|
The HTTP method used for making the request ... |
Read now
Unlock full access