winston version?_winston@2winston@3 node -v outputs:_ 8.16.1Sometimes, consistently, some of the calls to log results in the following error:
Unhandled "error" event. (Error: Callback called multiple times)
at DerivedLogger.afterTransform (./node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:82:17)
at DerivedLogger._transform (./node_modules/winston/lib/winston/logger.js:310:7)
at DerivedLogger.Object.<anonymous>.Transform._read (./node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:177:10)
at DerivedLogger.Object.<anonymous>.Transform._write (./node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:164:83)
at doWrite (./node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:405:139)
at writeOrBuffer (./node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:394:5)
at DerivedLogger.Object.<anonymous>.Writable.write (./node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:303:11)
at DerivedLogger.log (./node_modules/winston/lib/winston/logger.js:244:14)
at DerivedLogger.(anonymous function) [as verbose] (./node_modules/winston/lib/winston/create-logger.js:95:19)
I've not figured out the pattern of why it fails yet.
I expect it to throw a more useful error that would help me to identify what I'm doing wrong.
It felt related to ExceptionHandler problems at https://github.com/winstonjs/winston/pull/1355 https://github.com/winstonjs/winston/issues/1289 https://github.com/winstonjs/winston/issues/1261 https://github.com/winstonjs/winston/issues/511, but after few experiments doesn't so:
The error is back again. Went through winston code but didn't get smarter why it arises - can anyone point in the right direction please?
I have the same issue.
@Akuukis, did you find any solutions or workarounds?
@barinbritva No, I still have no clue.
@Akuukis, that's strange only we have this issue.
I thought maybe it's something not related with Winston and I did clean install of all project dependencies, but to no avail.
I have the same issue...
This error occurred for me after I had accidentally deep cloned the logger object. Hopefully that will help somebody.
@calvinjaramillo, thanks for your idea. I think, it's possible my situation.
Most helpful comment
This error occurred for me after I had accidentally deep cloned the logger object. Hopefully that will help somebody.