https://github.com/alyyousuf7/restify-tracer
Restify middleware to log request payload and response time
https://github.com/alyyousuf7/restify-tracer
nodejs restify
Last synced: about 1 month ago
JSON representation
Restify middleware to log request payload and response time
- Host: GitHub
- URL: https://github.com/alyyousuf7/restify-tracer
- Owner: alyyousuf7
- License: mit
- Created: 2017-03-13T16:43:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-14T10:39:11.000Z (over 9 years ago)
- Last Synced: 2025-01-19T12:51:40.716Z (over 1 year ago)
- Topics: nodejs, restify
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# restify-tracer
Restify request payload and response time logging middleware
## Options
| Option | Description | Default |
|---------|---------------------------------|---------|
| `limit` | Payload size limit in bytes.
Use `-1` for no limit. | `-1` |
| `hide` | List of parameters to hide when logging.
See [_.get](https://lodash.com/docs/#get). | `[]` |
## Usage
```javascript
'use strict';
const restify = require('restify');
const tracer = require('restify-tracer');
const server = restify.createServer();
server.use(restify.bodyParser()); // use body parser to enable `hide` feature
server.use(restify.requestLogger(), tracer({
limit: 1024,
hide: ['user.email', 'password']
}));
server.post('/', (req, res) => {
res.send('Hello World');
});
server.listen(3000);
```