Skip to content

Writes 'stdout' and 'stderr' to files: `error.log` `stderr.log` `stdout.log`

License

Notifications You must be signed in to change notification settings

manuel-lohmus/log-report

Repository files navigation

log-report: a Node.js Log Report library

npm-version npm-week-downloads

'log-report' is a simple to use. Writes 'stdout' and 'stderr' to files: error.log stderr.log stdout.log

Installing

npm install log-report

Usage example

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 file

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
    }
  }
}

License

MIT

Copyright (c) 2021 Manuel Lõhmus manuel@hauss.ee

About

Writes 'stdout' and 'stderr' to files: `error.log` `stderr.log` `stdout.log`

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published