The docs claim:
If you want to use this feature with the default logger, simply call .rejections.handle() with a transport instance.
//
// You can add a separate rejection logger by passing it to `.rejections.handle`
//
winston.rejections.handle(
new winston.transports.File({ filename: 'path/to/rejections.log' })
);
This probably was copied verbatim from the respective section on exception handling, but does not work. The winston object does not expose a .rejections property that's forwarded to defaultLogger.rejections, like it does for exceptions:
|
/** |
|
* Define getter for `exceptions` which replaces `handleExceptions` and |
|
* `unhandleExceptions`. |
|
* @type {Object} |
|
*/ |
|
Object.defineProperty(winston, 'exceptions', { |
|
get() { |
|
return defaultLogger.exceptions; |
|
} |
|
}); |
The docs claim:
This probably was copied verbatim from the respective section on exception handling, but does not work. The
winstonobject does not expose a.rejectionsproperty that's forwarded todefaultLogger.rejections, like it does for exceptions:winston/lib/winston.js
Lines 128 to 137 in 80d3439