"tail" the latest Lambda function's log by one line
Just hit the command below at the root of your CDK project.
npx cdk-lambda-log
- ✅ Fetch and follow the latest log stream of a single Lambda function
- ✅ Switch log stream automatically when cold start or new version of lambda is deployed
- ✅ You do not need to specify complex Lambda function names automatically generated by CDK
You can specify the stack name. If you do so, cdk-lambda-log
try to search Lambda functions created by the stack.
npx cdk-lambda-log --stack-name YOUR_STACK_NAME
You can specify the function name. If you do so, cdk-lambda-log
try to fetch the latest logs from Amazon CloudWatch.
npx cdk-lambda-log --function-name YOUR_LAMBDA_FUNCTION_NAME
cdk-lambda-log
is developed for use in debugging during development.
As such, it only displays logs from the most recent log stream.
If you want to view multiple log streams in a production environment, you can use cdk watch
or sam logs
.