Skip to content

Instantly share code, notes, and snippets.

@modster
Forked from ArunMichaelDsouza/app.js
Created November 16, 2021 03:19
Show Gist options
  • Save modster/85f7903e3dff75b8b88c1bce7d5ca15c to your computer and use it in GitHub Desktop.
Save modster/85f7903e3dff75b8b88c1bce7d5ca15c to your computer and use it in GitHub Desktop.
Woodlot middlewareLogger config
var express = require('express');
var app = express();
var woodlot = require('woodlot').middlewareLogger;
app.use(woodlot({
streams: ['./logs/app.log'],
stdout: false,
routes: {
whitelist: ['/api', '/dashboard'],
strictChecking: false
},
userAnalytics: {
platform: true,
country: true
},
format: {
type: 'json',
options: {
cookies: true,
headers: true,
spacing: 4,
separator: '\n'
}
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment