winstonjs / winston-daily-rotate-file

A transport for winston which logs to a rotating file each day.
MIT License
899 stars 156 forks source link

Can't use handleRejections: true with DailyRotateFile and TypeScript #313

Closed halfalicious closed 3 years ago

halfalicious commented 3 years ago

Still hitting issue #297 - I have winston-daily-rotate-file 4.5.2 installed....from my package.json:

    "winston-daily-rotate-file": "^4.5.2",

Digging into the DailyRotateFileTransportOptions -> TransportStream.TransportStreamOptions there's no "handleRejections" member:


declare namespace TransportStream {
  interface TransportStreamOptions {
    format?: logform.Format;
    level?: string;
    silent?: boolean;
    handleExceptions?: boolean;

    log?(info: any, next: () => void): any;
    logv?(info: any, next: () => void): any;
    close?(): void;
  }
}

Not that the type defns are for winston-transport 3.0:

// Type definitions for winston-transport 3.0
// Project: https://github.com/winstonjs/winston-transport
// Definitions by: DABH <https://github.com/DABH>
// Definitions: https://github.com/winstonjs/winston-transport

Are you sure that the new version of winston-transport was bundled with winston-daily-rotate-file 4.5.2?

mattberther commented 3 years ago

Ahh. You're right. winston-transport@4.4.0 was pushed on 21-Jun 2020, while https://github.com/winstonjs/winston-transport/commit/868d6577956f82ee0b021b119a4de938c61645f7 to update the TS was committed on 26-Jun 2020.

I updated the dependencies to make sure and pull in the specific commit while we wait to have a Winston-transport update pushed to npm by @DABH or @indexzero. This should be resolved with winston-daily-rotate-file@4.5.3.