Node-js logging utility
Node Js utility for logging, supported logger sinks: console, e-mail. In case the mail logger is to be used a send-grid account needs to be created. Message throthling can be activated so that destination is not overrun with e-mails. TODO: change mail style dependinh on the logging level TODO: add SMS sink support
Initial release of code and configuration examples. Tested on linux.
Clone or unzip repository. Open shell or the windows cmd, cd inside and type:
npm install
Configuration array is needed to instiate the logger. Example of the configuration parameters can be found in loggingTests.js
Simply reference in a different application: const mailLogger = require("../xtreamLogger/mailingLogger").MailingLogger;
CONSTRUCTION: Logger(logLevel)
LOGGING CALLs: setLogLevel(logLevelStr) info(message) debug(message) warning(message) error(message) critical(message)
The basic logging functionality can be tested by running:
- npm run test
- node loggingTests.js