Skip to content

winston.rejections is missing #1834

@ab-pm

Description

@ab-pm

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:

winston/lib/winston.js

Lines 128 to 137 in 80d3439

/**
* Define getter for `exceptions` which replaces `handleExceptions` and
* `unhandleExceptions`.
* @type {Object}
*/
Object.defineProperty(winston, 'exceptions', {
get() {
return defaultLogger.exceptions;
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions