A lightweight and efficient logging library for Node.js, designed for simplicity and flexibility.
This manual is also available in HTML5.
Log Report is a powerful yet simple tool designed to generate comprehensive reports of logs in a directory.
It helps analyze logs to identify errors, warnings, and other critical information, making it especially useful for applications running in multiple threads.
The tool is highly customizable, allowing you to tailor reports to your specific needs with ease.
This module is part of the 'conextra' framework,
which is a simple and easy-to-use single-page application (SPA) framework.
You have to try it! A different solution than MVC (model–view–controller).
To install the Log Report, you can use the following command:
npm install log-report
Short usage example:
/* short version */
require('log-report');
// Importing the 'log-report' module will automatically execute it in the current thread,
// saving the generated information.
Longer example:
/* longer version */
const logReport = require('log-report');
// Specifies the directory where logs will be saved.
logReport.logDir = "./log/log-report";
// Specify appropriate log file names.
logReport.stdoutFileName = "stdout.log";
logReport.stderrFileName = "stderr.log";
logReport.errorFileName = "error.log";
// This is useful if you want to start with fresh log files, especially during development or testing.
logReport.clearOnStartup = false;
// This is useful if you only want information about Uncaught Exception.
logReport.saveOnlyUncaughtException = false;
// This is useful if you want to get information about the PID of a process, especially during development or testing.
logReport.addProcessTag = false;
// This is useful if you want to get information about the file that started the process, especially during development or testing.
logReport.addFileTag = false;
// Suppresses terminal output when set to true.
logReport.silent = true;
// This is useful if you want to start with fresh log files, especially during development or testing.
logReport.clearLogFiles();
Config sets define the configuration for the log report and are located in the config-sets.json
file in the root directory of the project.
They enable dynamic, real-time modification of settings. For example, setting silent
to true
suppresses terminal output.
Refer to the Config-Sets section for detailed instructions on defining and using config sets.
{
"isProduction": true,
"production": {
"log_report": {
"logDir": "./log/log-report",
"stdoutFileName": "stdout.log",
"stderrFileName": "stderr.log",
"errorFileName": "error.log",
"clearOnStartup": true,
"saveOnlyUncaughtException": true,
"addProcessTag": false,
"addFileTag": false,
"silent": false,
"enabled": true
}
},
"development": {}
}
This project is licensed under the MIT License.
Copyright © Manuel Lõhmus