I created a lambda function with an API-Gateway using claudia.js. Now I need logs. Cloudwatch works, it shows me code errors with full stack information. But when I use console.log() I get no entry.
'use strict'
const awsServerlessExpress = require('aws-serverless-express')
const app = require('./app')
const server = awsServerlessExpress.createServer(app)
exports.handler = (event, context) => {
console.log(4, "Hello World!")
awsServerlessExpress.proxy(server, event, context)
}
-> No output in cloudwatch.
'
use strict'
const awsServerlessExpress = require('aws-serverless-express')
const app = require('./app')
const server = awsServerlessExpress.createServer(app)
exports.handler = (event, context) => {
conesole.log("Hello World!")
awsServerlessExpress.proxy(server, event, context)
}
Output in cloudwatch:
ReferenceError: conesole is not defined at exports.handler (/var/task/lambda.js:7:2)
Why are console.logs not shown?
consolenotconesole- kgangadhartest eventfor you function from the aws console and attach the output you see in the aws console. - Madhukar Mohanraju