http-logger
A cute and simple middleware for node.js that writes/log all HTTP requests to a file.
Usage
var logger = ;
logger(options)
Create a http-logger middleware function using the given options
.
The options
argument must be a object of a predefined properties (see below for the properties).
All options are optional
Options
http-logger accepts three properties in the options object.
dir
- Type :
String
- Optional : Yes
- Default value :'http_logger'
Directory name where you want to log the requests. Only pass directory name.
e.g.
;
file
- Type :
String
- Optional : Yes
- Default value :'http_logger'
File name where you want to log the requests. Only pass file name.
e.g.
;
dateWise
- Type :
Boolean
- Optional : Yes
- Default value :
false
If set true
then new log file will generate each day.
e.g.
;
Example
// Require the ingredients we needvar express = ;var http = ;var logger = ; // Build the appvar app = ; // Use our middlewareapp; // Add some middlewareapp; // Start it up!http;