ryantuck
ryantuck

Reputation: 6644

log to specific logstream in cloudwatch from lambda

I'd like to log to a specific CloudWatch log stream from lambda.

Currently, each lambda that fires off logs to a uniquely-named log stream, and often creates a new log stream as needed. This is problematic if I fire off 10 lambdas simultaneously with different events to process and want to look at the particular log stream for a given event type (that I could hypothetically define beforehand).

I'd like to be able to create a log stream in the console and specify to log to that particular log stream from within my lambda (python code), ideally without resorting to the boto3 module (although that's fine if it's the only way, of course).

enter image description here

Upvotes: 21

Views: 6382

Answers (1)

Jason Capriotti
Jason Capriotti

Reputation: 2060

This is a comment from @scolestock... It doesn't answer the question exactly (which I was hoping I'd find) but is a great alternative that helped me.

Use the "Search Log Group" option that appears above all the streams for a given log group? This will show the aggregate activity across the streams (and you let you search.)

That's basically what I need... viewing all logs across all streams.

Upvotes: 9

Related Questions