0.0.4 • Published 7 years ago

express-rest-logger v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Express REST logger

A lightweight Express middleware for intercepting REST calls and log them into a file.

Version

0.0.3

Installation

$ npm install --save express-rest-logger

Config

KeyDefaultDescription
path./logsThe folder used to store the log files.
filelog.txtThe name of the file.
dateFormatYYYY/M/D H:m:sThe format of the date of each REST call stored in the log file. Follow the Moment.js documentation to customize it.

Usage

const express = require('express');
const logger = require('express-rest-logger');

const app = express();

app.use(logger({
    path: 'logs-folder',
    file: 'log-filename',
    dateFormat: 'YYYY/M/D'
}));

app.get('/', (req, res) => {
   res.json({
       data: 'test data'
   });
});

app.listen('3000', () => {
    console.log('Application started');
});

License

MIT

0.0.4

7 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago