Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transporter Console - CloudWatch #1081

Closed
alifaff opened this issue Sep 22, 2017 · 1 comment
Closed

Transporter Console - CloudWatch #1081

alifaff opened this issue Sep 22, 2017 · 1 comment

Comments

@alifaff
Copy link

alifaff commented Sep 22, 2017

console.log('...')
output in cloudwatch: 2017-09-22T15:16:30.253Z 92da2c15-9f79-11e7-a6b1-7db1fdc140ea ...
logger.log('...')
output in cloudwatch: ...

How can we make winston also output the request id (lambda)?

I have the following code:

'use strict'

const winston = require('winston')

const logger = new winston.Logger({
  transports: [new winston.transports.Console()]
})
logger.transports.console.level =
  process.env.LOGLEVEL || process.env.npm_config_LOGLEVEL || 'error'
logger.transports.console.timestamp = true

module.exports.logger = logger

I want to emulate logger.log to output the same way that console.log does in cloudwatch. Thanks

@indexzero
Copy link
Member

Duplicate of #1250 – please consider upgrading to winston@3 and using the 'finish' event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants