easy-loger
v2.0.0
Published
ReadMe and instruction for easy-loger module
Downloads
6
Readme
ReadMe and instruction for easy-loger module
Base information:
*Use node.js in v10.x
*Log file is in main project file
*Log file name is log.txt
##Wht is easy-loger? Easy-loger is light engine for create log form application. Logs are in txt file in a configurable path. Log file are created automatic on demand. The Newest log row is the last row in log.txt. Configuration for log engine are in .env file. Config parameter: consolePrint - value "true" - show all log message in system console, "false" - log message are not print in system console logLevel - value "error" - engine save only error log, "warning" - engine save only warning and error log, "info" - engine save only info message, "all" - engine save all log message If console print is running engine show all message regardless to logLevel.
How to create log
1.Add easy loger config to .env file, LOG_FILE_PATH=./log.txt
LOG_LEVEL=all
CONSOLE_LOG_PRINT=true
2.Add logger module to node const log = require('easy-loger');
3. Add Create Log function log.createLog(message, message level)
, where message is string log information, available levels is: info, warning, error.
All Create Log parameter are string and must be in "" !
Change log
Version | Description --------|------------ 1.0.1 | Initial version with JSON config file 1.0.2 | Fix problem with: log.txt path, package run. Add to read me information how to run package config 2.0.0 | Change config source to .env file JSON config is not available. Added configurable path for log.txt