Send logs from your Vercel apps to GraphJSON for easy debugging, troubleshooting and alerting.
Vercel wraps all your console logs in the context of the request. They're buried in the message in your log event metadata. This is the stdout dump from your lambda runs. AWS gives us some metadata about the request in the report section along with the stdout string.
You can thus extract the stdout using a JSON extract function, eg.
SELECT timestamp, JSONExtractString(json, 'message') as stdout FROM logs LIMIT 10
For errors, each event has a message field with ERROR in it. Thus to find all logs with errors, we simply need to add a LIKE filter
SELECT timestamp, JSONExtractString(json, 'message') as stdout FROM logs WHERE JSONExtractString(json, 'message') LIKE '%ERROR%' LIMIT 10