0
votes

I would like to ask about Lambda and CloudWatch logs. I see that once you create a Lambda the log structure behind is always like "/aws/lambda/".

What I would like to do is my own CloudWatch group "/myLogs" and then set to Lambda to log into this CloudWatch group. As I was reading some documentation about this it looks like that this was not possible in past, is there any update on that now is it possible to do it and how ?

Thanks.

1
Nope, haven't seen anything like that. - John Rotenstein
It's not possible. - Mark B
I think that is not possible. Its set that way so that it is easy to see categorized set of log groups - Althaf1467
While you can't do what you're asking, why not create your group under /aws/lambda such as /aws/lambda/myLogs and logs to that group. - noobius

1 Answers

0
votes

By default, the log group gets created by the name /aws/lambda/. I haven't explored through console, but if you are using cdk, you can use aws_logRetention method construct of aws_lambda construct. https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_lambda/LogRetention.html This will create a log group by the name you provide (but it will still follow the convention of /aws/lambda/....

You can set the retention days as well and manage the logs.

You can try it once.