I'm trying to setup Amazon Cloud Watch as a remote logging destination for some C# applications I am working on. One thing that is not clear to me is the difference between a Log Group and a Log Stream and how they should be used?
I have a number of small applications which many different users will be running on many computers. So I would like to be able to easily identify the source application, and machine for each log message.
My understanding is a Log Stream is a "sequence of log events that share the same source", so it seems like I would want to create a new Log Stream for each machine or each user per machine. Does this sound right?
A log stream represents the sequence of events coming from an application instance or resource that you are monitoring. There is no limit on the number of log streams that you can create for a log group.
CloudTrail uses a CloudWatch Logs log group as a delivery endpoint for log events. You can create a log group or specify an existing one. Make sure you are logged in with an administrative IAM user or role with sufficient permissions to configure CloudWatch Logs integration.
The AWS::Logs::LogGroup resource specifies a log group. A log group defines common properties for log streams, such as their retention and access control rules. Each log stream must belong to one log group. You can create up to 1,000,000 log groups per Region per account.
The log stream contains messages from that execution environment and also any output from your Lambda function's code. Every message is timestamped, including your custom logs, which means you do not need to output timestamps.
It all depends on the level of aggregation that you want:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With