1.1.0 • Published 7 years ago
log-to-file-and-console-node v1.1.0
log-to-file-and-console-node
Simple winston wrapper transport log to file and console.
Installation
npm install log-to-file-and-console-node --save
Usage
// set env variable (default: '/logs')
process.env.LOG_DIR='/logs';
In app.js
generated by express
var express = require('express');
var morgan = require('morgan');
var log = require('log-to-file-and-console-node');
// Load required packages
var app = express();
app.use(morgan('combined', {'stream': log.stream}));
log.i('hello world');
log.e(new Error('error!'));
Author
License
log-to-file-and-console-node
is available under the MIT license. See the LICENSE file for more info.