Prompt

How do I see stack traces from serverless errors?

Technology / Observability1 observationLast seen Oct 20, 2026

Latest observation

Oct 20, 2026OpenAI APIWeb search: off

To see stack traces from Serverless Framework function errors, you usually need to look in the cloud provider logs, because stack traces are often logged there rather than in the deployment output.

On AWS Lambda

1) Check CloudWatch Logs

Go to:

  • AWS Console → CloudWatch → Log groups
  • Open the log group for your function:
    • /aws/lambda/<function-name>

You’ll see the error and stack trace in the log stream.

2) Use serverless logs

You can tail logs from the CLI:

serverless logs -f <functionName> -t

To get recent logs:

serverless logs -f <functionName> --tail

If you want a specific time window:

serverless logs -f <functionName> --startTime 1h

3) Make sure your code logs the error

If you catch errors, log them explicitly:

try {
  ...
} catch (err) {
  console.error(err.stack || err);
  throw err;
}

If you only do throw new Error(...), Lambda usually includes the stack trace in CloudWatch, but if you swallow the error, it won’t appear.

4) If using API Gateway, return the error properly

If your handler catches the exception and returns a generic response, the stack trace won’t surface. Re-throw the error or log it first.


On other providers

  • Azure Functions: check Application Insights / Log Stream
  • Google Cloud Functions: check Cloud Logging
  • OpenWhisk / other runtimes: use the provider’s function logs

If you mean local Serverless debugging

Run locally with more verbosity:

SLS_DEBUG=* serverless invoke local -f <functionName>

or:

serverless invoke local -f <functionName> --data '{}'

If you’re using Node.js, you can also run with:

NODE_OPTIONS="--trace-uncaught --trace-warnings" serverless invoke local -f <functionName>

Best practice

Make sure your function logs the full error object:

console.error("Function failed:", err);

or:

console.error(err.stack);

If you tell me which provider you’re using, I can give the exact command/path to see the stack trace.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.