Prerender plugin for creating access log file with morgan, to be used with the prerender node application from https://github.com/prerender/prerender.
In your local prerender project run:
npm install prerender-access-log --save
Then in the server.js that initializes the prerender:
server.use(require('prerender-access-log'));
The plugin uses the morgan for creating logs and file-stream-rotator for managing file names.
var server = prerender({
accessLog: {
// Check out the file-stream-rotator docs for parameters
fileStreamRotator: {
filename: '/var/logs/prerender/access-%DATE%.log',
frequency: 'daily',
date_format: 'YYYY-MM-DD',
verbose: false
},
// Check out the morgan docs for the available formats
morgan: {
format: 'combined'
}
}
});