Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ArunMichaelDsouza
Created April 3, 2019 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArunMichaelDsouza/c0c123eecacdab691348fc0f0c9cb028 to your computer and use it in GitHub Desktop.
Save ArunMichaelDsouza/c0c123eecacdab691348fc0f0c9cb028 to your computer and use it in GitHub Desktop.
Woodlot customLogger config
var express = require('express');
var app = express();
var woodlotCustomLogger = require('woodlot').customLogger;
var woodlot = new woodlotCustomLogger({
streams: ['./logs/custom.log'],
stdout: false,
format: {
type: 'json',
options: {
spacing: 4,
separator: '\n'
}
}
});
app.get('/', function(req, res) {
var id = 4533;
woodlot.info('User id ' + id + ' accessed');
return res.status(200).send({ userId: id });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment