2.0.0 • Published 8 years ago

simple-express-logger v2.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

simple-express-logger Build Status

##Description Logs requests to the console in a format like this: Request: {GET} /api/foo

NOTE: This simply logs every request coming into the server, not just requests who's routes have been handled in express

##Usage 1. Install via npm: $ npm install --save simple-express-logger 2. Import and instantiate the module, then use it as middleware

var express = require('express');
var logger = require('simple-express-logger');

var app = express();
app.use(logger());

Checkout the API section for information about customization through an optional options object

API

logger([options])

  • options <Object> Set of configurable options. Can have the following fields:

    • customOutput <Function> Function used in place of console.log. Useful for externally redirecting the output.
    • extraFields <Array String> Set of field names on the req <Object> to also be logged. For example, an options object of { extraFields: [ 'headers' ] } will log somthing similar to the following line: headers: "{ "foo": 1, "bar": 2 }"
2.0.0

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago