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

Add support for logs of all lambda functions #841

Closed
jamesls opened this issue May 16, 2018 · 4 comments
Closed

Add support for logs of all lambda functions #841

jamesls opened this issue May 16, 2018 · 4 comments

Comments

@jamesls
Copy link
Member

jamesls commented May 16, 2018

The chalice logs command was written when there was only a single lambda function used as your API handler. I've found it really useful, but I'd like to be able to use this command for all the lambda functions in my app.

I'd like a -f/--function-name arg added that lets me provide the logical resource name of the function whose logs I'd like.

Example

Given this app:

@app.lambda_function()
def foo(event, context): ...

@app.route('/')
def index(): ...

The chalice logs command will continue to give me lambda logs for my API handler, but I can now also say:

$ chalice logs -f foo

and it will give me logs for the foo function. Also I'd like to get #4 added as well so I might need to work out if we want -f to mean what tail -f means or if we just want to use --tail.

@kyleknap
Copy link
Contributor

Yes! Both would be awesome.

@kadrach
Copy link
Member

kadrach commented May 17, 2018

Perhaps slightly off-topic, but functionality to both enable (possible in SAM since 1.4.0) and get APIGateway logs would be awesome!

@aalvrz
Copy link
Contributor

aalvrz commented May 17, 2018

This sounds excellent. Never knew there was a chalice logs command. I am assuming these logs get pulled from CloudWatch?

@jamesls
Copy link
Member Author

jamesls commented May 19, 2018

@BigChief45 yep they get pulled from cloudwatch logs. It also has some abstraction on top of the low level cloudwatch logs call to make the logs easier to read. I added a few examples over in #841 but our docs could probably use more examples.

@kadrach I'd like that as well, it's sometimes the only way to track down issues with bad responses from Lambda. I've created #849 to track this work.

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

4 participants