Takaro - v0.6.0
    Preparing search index...

    Function createSentryWinstonTransport

    • Creates a new Sentry Winston transport that fowards logs to Sentry. Requires the enableLogs option to be enabled.

      Supports Winston 3.x.x.

      Type Parameters

      • TransportStreamInstance extends object

      Parameters

      • TransportClass: new (options?: any) => TransportStreamInstance

        The Winston transport class to extend.

      • OptionalsentryWinstonOptions: WinstonTransportOptions

      Returns new (options?: any) => TransportStreamInstance

      The extended transport class.

      const winston = require('winston');
      const Transport = require('winston-transport');

      const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport);

      const logger = winston.createLogger({
      transports: [new SentryWinstonTransport()],
      });