How to: Search AWS-Hosted Application Error Logs
Matthew Buhr
Posted on October 31, 2022
Has an application hosted on AWS been throwing an error, and you do not know why?
The AWS Cloud Service which logs application insights and errors is CloudWatch. While logged into the AWS console, you can search for this service. After in the service, search for "Logs Insights". This will give you a categorical list of logs for every application or other entity which outputs logs.
On the Logs Insights page, you can select log groups that you desire to see information for. For application errors, the appropriate log group is "stdouterrr", and you can select for which applications you want to see these application logs for.
The default query is:
fields @timestamp, @message
| sort @timestamp desc
| limit 20
You can modify this query by removing the limit line. You can also change your sort parameters or remove them entirely, though sorting by timestamp is helpful as it gives you the most recent logs.
Additionally, you can filter on the message field by modifying your query to the following:
fields @timestamp, @message
| filter @message like /message like this/
| sort @timestamp desc
This is helpful when you want to find errors related to a specific call or API endpoint, which often is listed in the error message.
Posted on October 31, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.