litixsoft / log4js-node-mongodb

A log4js-node log appender to write logs into MongoDB
MIT License
39 stars 23 forks source link

Getting exception while adding appender #6

Open deftscorpio opened 7 years ago

deftscorpio commented 7 years ago

I am getting exception when trying this line:

log4js.addAppender( mongoAppender.appender({connectionString: 'localhost:27017/logs'}), 'cheese' );Exception:

Exception has occurred: Error TypeError: log4js.addAppender is not a function at Object. (d:\myScriptFile.js:28:8) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Timeout.Module.runMain [as _onTimeout] (module.js:590:10) at tryOnTimeout (timers.js:232:11) at Timer.listOnTimeout (timers.js:202:5)

Using these versions:

"log4js": "2.0.1", "log4js-node-mongodb": "2.2.1",

Thanks.

prabhatmishra33 commented 6 years ago

facing the same issue!

"log4js":"2.5.3" "log4js-node-mongodb": "2.2.1"

fendoude007 commented 5 years ago

log4js dont have addAppender function; base code is const log4js = { getLogger, configure, shutdown, connectLogger, levels, addLayout: layouts.addLayout, }; module.exports = log4js;

hanhui commented 5 years ago

facing the same issue