lazywithclass/winston-cloudwatch

How to pass `winston.format.json()` as a formatter?

Opened this issue · 1 comments

This will cause a TS error:

        new WinstonCloudWatch({
            level: 'info',
            logGroupName: 'Name',
            logStreamName: 'Main',
            awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID as string,
            awsSecretKey: process.env.AWS_SECRET_KEY as string,
            awsRegion: 'eu-central-1',
            messageFormatter: winston.format.json(),
        }),

I expected it to work like the in the stock transports of Winston e.g.

        new winston.transports.Console({
            level: 'debug',
            format: winston.format.json(),
        }),

I am working on a new version of this module that will follow Winston's transports defaults.

#130

Let's come back to this after that PR is closed.