Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twipped/morgan-debug
An extension of the morgan express logger to output through the debug library.
https://github.com/twipped/morgan-debug
Last synced: about 2 months ago
JSON representation
An extension of the morgan express logger to output through the debug library.
- Host: GitHub
- URL: https://github.com/twipped/morgan-debug
- Owner: Twipped
- Created: 2014-08-07T20:28:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-10T16:52:23.000Z (about 8 years ago)
- Last Synced: 2024-11-12T16:04:34.044Z (about 2 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 11
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
morgan-debug
===Morgan-debug is an express middleware which composes the [`morgan`](https://www.npmjs.org/package/morgan) logger middleware with the [`debug`](https://www.npmjs.org/package/debug) console output library for a consistent logging output with other library debug info.
```
npm install morgan debug morgan-debug
```Note that `morgan` and `debug` are both peer dependencies and must be installed separately.
## Usage
**`morganDebug(namespace, format, [options]);`**
- `namespace` (string): The debug namespace or a debug function
- `format` (string): The morgan format string
- `options` (object): Optional options to pass through to morgan```js
var express = require('express');
var morganDebug = require('morgan-debug');var app = express();
app.use(morganDebug('myapp', 'combined'));
```See the respective libraries for details of their operation and options.