Usage
const {debug,error,warn,info } = require("b-logger")("logger.tag")
debug("debug")
error("error")
debug
,error
,warn
,info
are logger functions.
(message:string,...params:any[])=>void
Configure
easy-logger
read json and config log4js.
- current working directory/logger.json
- start up script's director/logger.json
Example:
{
"level": "debug",
"error": {
"path": "./log/error.log",
"fileNamePattern": "-dd"
},
"warn": {
"path": "./log/warn.log",
"fileNamePattern": "-dd"
},
"info": {
"path": "./log/info.log",
"fileNamePattern": "-dd"
},
"debug": {
"path": "./log/debug.log",
"fileNamePattern": "-dd"
}
}
pattern see here