'log-report' is a simple to use.
Writes 'stdout' and 'stderr' to files:
error.log
stderr.log
stdout.log
npm install log-report
app.js
/* longer version */
//var logReport = require('log-report');
//logReport.clear();
/* short version */
//require('log-report');
require('./index.min.js');
console.log('Log test.');
console.warn('Warn test');
console.error('Error test.');
setTimeout(function () { throw new Error('Throw Error: ...!'); }, 100);
config-sets.json Read more...
{
"production": {
"isDebug": false,
"log_report": {
"logDir": "./log/log-report",
"enabled": true,
"save_only_uncaughtException": true,
"clear_on_startup": false
}
},
"development": {
"isDebug": true,
"log_report": {
"enabled": true,
"save_only_uncaughtException": false,
"clear_on_startup": true
}
}
}
Copyright (c) 2021 Manuel Lõhmus manuel@hauss.ee