log4js-node-mongodb icon indicating copy to clipboard operation
log4js-node-mongodb copied to clipboard

Getting exception while adding appender

Open deftscorpio opened this issue 8 years ago • 3 comments

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.

deftscorpio avatar Jul 12 '17 13:07 deftscorpio

facing the same issue!

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

prabhatmishra33 avatar Apr 13 '18 10:04 prabhatmishra33

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

fendoude007 avatar Jul 25 '19 06:07 fendoude007

facing the same issue

hanhui avatar Aug 04 '19 05:08 hanhui