Logging and AWS Beanstalk

Logging and AWS Beanstalk

After creating an ASP.NET Beanstalk application, you might be wondering, “Where are my logs?”

Without configuring CloudWatch, my logs do show within the Beanstalk UI. Note: The below image assumes no CloudWatch.

Beanstalk environment

After clicking Logs, you need to click Request Logs and then select how much you want to see. I usually select Last 100 Lines.

Last 100 Lines

Then I can just download the logs and look through the messages.

Logs

The “Received Request” message is a custom log I put into my code.

"Received Request" message in custom log

Making CloudWatch work with Beanstalk (abbreviates to BS which isn’t good 😊) is pretty straightforward too. No code change is required.

Beanstalk environment

Click Edit in the Software section.

Click the Edit button

Enable instance log streaming to CloudWatch.

Enable instance log streaming

References

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.cloudwatchlogs.html

author avatar
Chad Michel Senior Software Architect
Chad is a lifelong Nebraskan. He grew up in rural Nebraska and now lives in Lincoln. Chad and his wife have a son and daughter.

Related posts