How to stream custom logs to CloudWatch using elastic beanstalk in AL2023

1

I have upgraded my elastic beanstalk environment to using AL2023 recently and notice that the previous approach stated in How to stream custom logs to CloudWatch using elastic beanstalk no more work again since awslogs package has been removed in AL2023.

What approach should be used in AL2023 to stream custom logs to cloudwatch provided that elastic beanstalk auto-scaling is enabled (i.e. no further operation on ec2 instance is preferred)?

Thanks.

2 Answers
1
Accepted Answer
profile picture
EXPERT
answered 8 months ago
0

The solution to this is spread out in the guides so it is not very easy to assemble.

Here is the section from elastic beanstalk guide for custom cloudwatch config. Note the permissions required in the instance profile. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-cw.html

Also, in the logs section of the guide for writing the cloudwatch agent configuration file you will find the description of different properties required to set custom log groups and read from particular files into the log streams. https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html

Finally in the new Amazon Linux, the cloudwatch agent is already installed so you don't need the package command to install it in the ebextension configs.

Keshav
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions