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.
After clicking Logs, you need to click Request Logs and then select how much you want to see. I usually select Last 100 Lines.
Then I can just download the logs and look through the messages.
The “Received Request” message is a custom log I put into my code.
Making CloudWatch work with Beanstalk (abbreviates to BS which isn’t good 😊) is pretty straightforward too. No code change is required.
Click Edit in the Software section.
Enable instance log streaming to CloudWatch.
References
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.cloudwatchlogs.html