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

cdk logs #277

Closed
1 of 7 tasks
eladb opened this issue Dec 9, 2020 · 2 comments
Closed
1 of 7 tasks

cdk logs #277

eladb opened this issue Dec 9, 2020 · 2 comments
Labels
status/stale The RFC did not get any significant enough progress or tracking and has become stale.

Comments

@eladb
Copy link
Contributor

eladb commented Dec 9, 2020

PR Champion
#

Description

$ cdk deploy
...
$ cdk logs
[construct path] [timestamp] text
[consrruct path] [timestamp] text

This command will query all the log groups in the CDK all from CloudWatch Logs and will print all the log events starting from deployment end time until now.

$ cdk logs --follow|-f

Will continue to stream incoming logs from CloudWatch every few seconds.

We will need to add framework support for registering log groups by L2 resources:

class lambda.Function {
  constructor() {
    // ...
    Stack.of(this).addLogs(Logs.fromCloudWatch(`lambda/{this.functionName}`);
  }
}

Since the log group name is likely to include deploy-bound values (such as the AWS Lambda function name), the addLogs() method will simply add a CfnOutput to the stack which will include comma-separated names of all the log groups in this app. The output will have a well known name which the CLI will use to query the log groups associated with this app.

Progress

  • Tracking Issue Created
  • RFC PR Created
  • Core Team Member Assigned
  • Initial Approval / Final Comment Period
  • Ready For Implementation
    • implementation issue 1
  • Resolved
@eladb eladb added the status/proposed Newly proposed RFC label Dec 9, 2020
@kirkness
Copy link

I've implemented a similar mechanism in CDK-Watch which derives the function names by looking up the resource in CF using its logical ID. You should be able to run cdkw logs "Path/To/API/**" to match all lambdas under this path and poll their log streams.

I'm also experimenting with adding a Lambda Extension that forwards logs onto an APIGW WebSocket API, allowing for real-time lambda logs in the CLI.

@mrgrain mrgrain added status/stale The RFC did not get any significant enough progress or tracking and has become stale. and removed status/proposed Newly proposed RFC labels Oct 13, 2023
@awsmjs
Copy link
Contributor

awsmjs commented Dec 15, 2023

Closing this ticket as it is stale and will be covered as part of #583

@awsmjs awsmjs closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/stale The RFC did not get any significant enough progress or tracking and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants