CloudWatch Logs

CloudWatch Logs

  1. On the main CloudWatch page:

    • Expand the Logs menu on the left sidebar.
    • Select Log groups.

4.1.1

  1. In the search bar, enter /ec2 and select /ec2/linux/var/log/messages.

4.1.2

4.1.3

  1. Choose any instance to view its logs.

4.1.4

  1. Here, you can see logs generated by the instance from various sources such as dhclient, NET, ec2net, systemd, and more.

4.1.5

  1. Go back to the /ec2/linux/var/log/messages log group details. Now, set up the log retention period.

    • Click Actions.
    • Select Edit retention setting.

4.1.6

  1. In the Retention setting, choose 1 week (7 days) for Expire events after.

4.1.7

4.1.8

That’s it! These basic operations help you understand where logs in your instance originate from, including services and applications generating them.