Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does AWS CloudWatch create new log streams?

AWS CloudWatch has Log Groups and Log streams. A log group seems reasonable to me: Each product (e.g. each Lambda function, each Sagemaker endpoint) has its own log group.

But then there are log streams. When does AWS CloudWatch create new log streams? Can I search all log streams of a log group?

like image 429
Martin Thoma Avatar asked Feb 07 '18 08:02

Martin Thoma


People also ask

How are log streams created?

Creates a log stream for the specified log group. A log stream is a sequence of log events that originate from a single source, such as an application instance or a resource that is being monitored. There is no limit on the number of log streams that you can create for a log group.

How long does it take for CloudWatch logs to appear?

It may take 5 to 10 minutes for logs to show up after a function invocation.

How long does it take for CloudWatch logs to update?

The CloudWatch Logs Agent will send log data every five seconds by default and is configurable by the user.

How are CloudWatch logs created?

To create a log groupOpen the CloudWatch console at https://console.aws.amazon.com/cloudwatch/ . In the navigation pane, choose Log groups. Choose Actions, and then choose Create log group. Enter a name for the log group, and then choose Create log group.


1 Answers

From the AWS Cloudwatch documentation you can see that a log stream is created each time the logs come from a different event source. In case of Lambda, it's one stream per Lambda container where each container might process multiple events.

A log stream is a sequence of log events that share the same source. Each separate source of logs into CloudWatch Logs makes up a separate log stream.

Yes, you can search all log streams of a log group using the CloudWatch Logs API. The FilterLogEvents action allows you to search through a log group.

like image 63
rvelaz Avatar answered Dec 21 '22 01:12

rvelaz