node-ez-logger
v1.0.7
Published
Simple logger module for node.js
Downloads
4
Readme
Node EZ Logger
Simple logging module for node.js
Introduction
This module is writing log messages to the console and to files in the log folder.
Usage
Install
Install the package with NPM
npm install node-ez-logger
Require
In your script file include the module
const logger = require('node-ez-logger');
Use
In your code you can log with info(), warning(), error() or debug() methods
logger.info('info message in the log');
logger.warning('warning message in the log');
logger.error('error message in the log');
logger.debug('debug message in the log');
Configuration
You have the possibility to change the path, where the file will be placed, and the format of the date in the logfiles and in the console.
Date Format
logger.config.dateFormat(format: string): void
logger.config.dateFormat('Y-m-d H:i:s,V');
Log Path
logger.config.logPath(path: string): void
logger.config.logPath('custompath/logs');