I'm a little confused on what exactly this means. There is an "explanation" on the github page for Winston, that says you can exit, or not exit. Does that mean that the Winston object dies or stays, or that the node.js process dies or stays? Or something else entirely? I can't find any decent explanations.
Asked
Active
Viewed 3,171 times
1 Answers
16
By default, node.js will terminate on uncaught errors. Winston can catch and log these errors.
If exitOnError is true (the default), Winston will subsequently end the node process, just like node's default behavior. If exitOnError is set to false, the error will be logged and the process will continue.

weiyin
- 6,819
- 4
- 47
- 58
-
But if no transport is added and exitOnError is false, its not working. Which means it terminates the process. – Priyank Sheth May 17 '19 at 11:48
-
12Unbelievable that such option even exists in logging library. – struhtanov Nov 28 '19 at 19:40
-
@struhtanov wdym? – Cardin Aug 05 '20 at 07:25
-
@struhtanov Is this save to use? On the node documentation it says that it can corrupt the application. https://nodejs.org/api/process.html#process_event_uncaughtexception – SomeCoder Nov 16 '20 at 20:08
-
7@Cardin winston is logging library. How on earth it can deal with application termination flow? If I want my process to continue after uncaught error(which is doubtful) I will handle this myself, no need to hide this in LOGGING library. – struhtanov Nov 18 '20 at 12:32
-
@SomeCoder The complexity and mission-criticality of your application will determine how safe it is to continue a faulted application. In a idealistic world, uncaught exceptions should never be allowed to bubble all the way till nodejs terminates/winston catches it. – Cardin Nov 19 '20 at 04:22
-
3I have faced an important production issue because some smart dev set exitOnError to true and the process was getting stalled. How in the world this is a sane feature !? – Daniel San Dec 03 '20 at 03:47